What is your workflow when you have to do a tech review and there are a bunch of CSS-like files?
Do you follow some guidelines? Do you build the feature branch somewhere? Or you just close your eyes 🙈, click on the 'Viewed' checkbox and let the QA guys do the rest? 😬
Top comments (12)
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.
Why setting z-index are bad practices and should avoided? Overlay, modal, etc works with z-index isn't it?
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
Oh, thank you. I think I need do research about a11y and
z-indexis bad for accessibility (like screen readers) because it sort of places stuff in the wrong order and confuses people.
But at the same time, remember that
z-indexis useful in some situations like popups or banners or nitty gritty stuff.
Branch of frameworks and libraries working with tabindex and z-index.
For us, first round of reivew is done by stylelint. What I usually check for in the next round are: are they
Typically the question for me is... "Does this accurately follow patterns we have established in a healthy way?". Guidelines are great, but it is hard to be absolute about certain things, you sort of need to evaluate whether the current change follows patterns that lead to better overall CSS.
@pp is that okay?
I think that makes sense.
I'd also add that sometimes devs tend to sneak-in some hacks in CSS more often than in other files :D I usually try to catch these and simplify when reviewing someone's CSS code. It all eventually affects readability but also maintainability of code.
Off the top of my head, these are the sorts of things that would cross my mind when reviewing a PR for a UI framework:
Those are the only ones I can think of that are actionable. "Does it feel right?" doesn't really count, but it would be on my list.
Thank you all for your time/responses, much appreciate ❤️.
I'd say that our workflow is very similar to the one described by @robie577 and @antonfrattaroli.
We use BEM, Stylelint, SCSS variables, mixins, and so on. Could be complex when the project is big and you have to deal with many devs with different skills/seniority.
Anyway, I think that one of the important aspects is how solid is your UI / Design System, which is maybe close to what @ben said, if I understood correctly 😬.
If you have a poor UI/DS, you are open to a variety of ‘style combinations’ (even small stuff) that are ‘perfectly fine’ from a UI perspective, but they could lead you to a difficult review process with a bloated CSS code to maintain.