|
|
|
|
|
by lelanthran
1061 days ago
|
|
I think the real problem is that CSS mixes in two many different concerns. If I want to create a reusable component I need to control the layout tightly, and use media queries for display size. The user of the component needs to control the colour and cosmetic stuff, while also using media queries, but for dark/light mode. All four use cases use the same bloody input - CSS! Which means all of the different parties are stepping on each others toes because they may accidentally set a property that needs to be set by a different party. It's not designed for separation of concerns. |
|
All of the four mentioned use cases are stylistic. So it is desirable to accomplish them in a domain-specific styling language.
Used correctly, conflicting regressions are greatly minified.
It's just the problem with CSS that the vast number of developers don't know about its fundamentals, such as "CSS Specifity"
https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity
This collective lack of knowledge leads to the kind of "monkey patching until it works for me (and breaks for you)" many lament about.
Feel free to give an concrete minimum viable example (including code) where you are struggling with CSS, and I will try to give suggestions.