3 ms·
How does it make composing classes hard? Genuinely curious what the exact difficulty here is. For the record, I don’t follow how the cascade applies in the con
by eurasiantiger 4y ago
How does it make composing classes hard? Genuinely curious what the exact difficulty here is.
For the record, I don’t follow how the cascade applies in the context of an element declaring multiple CSS classes, as their precedence is defined by the order they first appear in CSS.
If the problem seems to be in how descendant elements’ classes compose the cascade, maybe the affected styles could be scoped less broadly?
Also, the @layer syntax seems to obviate this issue: simply define your typography on a different cascade layer separate from your container boxes and whatnot.
- klysm 4y agoYeah but why would you go through all that trouble when rem exists to solve this exact problem with font sizes.
- eurasiantiger 4y agoThat’s not exactly true — using rem does solve the problem, but certainly that’s not explicitly the use case it was meant for. I like being able to increase the sizings of all elements inside a container just by increasing the element’s font-size.
- klysm 4y agoI guess there is a use case for that, but I've never wanted to do that.
- eurasiantiger 4y agoIt comes in handy on large multi-brand enterprise sites where the same styles serve multiple domains. They are sharing layout but not necessarily the colors, dimensions, typography, iconography, or shape language. It makes sense to systemically separate concerns in an environment like that, because it makes the same developers able to efficiently work on any of the sites; developers meaning one or more in-house teams, possibly with external consultants.