DEV Community

Discussion on: How do you review CSS?

Collapse
 
loucyx profile image
Lou Cyx

You should check for a11y issues (bad color contrast, animations not wrapped in user preference, small font sizes, etc), or lack of usage of app defined stuff such as margins, paddings, color palettes, sizes and so on, or usage of px over other better units. You should also check that bad practices such as setting z-index are avoided.

Collapse
 
thexdev profile image
M. Akbar Nugroho

Why setting z-index are bad practices and should avoided? Overlay, modal, etc works with z-index isn't it?

Collapse
 
codingjlu profile image
codingjlu

z-index is bad for accessibility (like screen readers) because it sort of places stuff in the wrong order and confuses people.

Collapse
 
loucyx profile image
Lou Cyx

As @codingjlu pointed out, is an a11y issue. If you want to put something in top of something else, you should be using the DOM order, not z-index. Is as bad as setting tabindex in HTML.

Thread Thread
 
thexdev profile image
M. Akbar Nugroho

Oh, thank you. I think I need do research about a11y and z-index

Collapse
 
codingjlu profile image
codingjlu

But at the same time, remember that z-index is useful in some situations like popups or banners or nitty gritty stuff.

Collapse
 
eugenman profile image
Eugen

Branch of frameworks and libraries working with tabindex and z-index.