4 ms·
I'm not going to defend the article, but I really bristle at this idea that if you just _get_ CSS it isn't problematic anymore. CSS tries to solve a hard proble
by marijn 6y ago
I'm not going to defend the article, but I really bristle at this idea that if you just _get_ CSS it isn't problematic anymore. CSS tries to solve a hard problem and it's certainly preferably to inline-everything, but its design (global, cascading, with many types of behavior—positioning, z-stacking, etc—depending on the styling of parent elements in interesting ways) is actively hostile to many kinds of modularity, and that's a real issue even for people who "get" CSS.
- IfOnlyYouKnew 6y agoCascading / depending on the parent's style are features specifically intended to enable a component-based approach. It allows, for example, to use h1's in your component, but have them render at appropriate sizes depending on their level in the overall hierarchy.
- lioeters 6y agoCascading is, to me, like class inheritance in object-oriented style of programming. Useful in some cases, but can become unmanageable with more than a few layers. The "inline CSS" approach is an escape hatch to avoid cascading styles. I can see its advantages, to apply all (and only) the styles on the component level.
- lioeters 6y agoApparently someone didn't appreciate the jab at OOP. Well, I call it like I see it - seen more messes made by class inheritance and cascading, than without.
- type0 6y agoThere's also this grouping method to separate classes https://piccalil.li/cube-css/ https://piccalil.li/cube-css/ it's cringe at first but so was BEM and it's still useful even if you combine both