Codeminer42, a Brazilian software company, writes about Ruby, Rails, React, front-end patterns, and other engineering topics.
HN links it for its Rails and React posts; one commenter singles out a post on working with the Lean 4 language as fun.
> Should I group by behaviour type — put all the margins and padding in one place, all the font stuff in another? How does that jive with grouping in a different dimension: by element hierarchy. All the buttons stuff in one file. All the headings stuff in another.
I've been where you are.
All I can say is Inverted Triangle CSS (ITCSS) [1] solves the issues you're talking about. It's so obvious once you get it—it's one of those "why didn't I think of this" kind of thing. You write your code in specificity order. It sounds odd at first but it makes total sense and eliminates so many of the "issues" people complain about. It makes the cascade your friend and not your foe.
[1]: https://blog.codeminer42.com/how-to-organize-your-styles-with-itcss-3787cbc6dcbf
I thought this post was fun:
https://blog.codeminer42.com/overcoming-challenges-and-crafting-in-the-uncharted-territory-of-lean4/