Re:Inline CSS works better in a component world
by floppiplopp on Thursday August 20, 2020 @04:36AM
(#24221185)
And so, the modern web becomes an unmaintainable, monolithic clusterfuck with the illusion of modularity. It's the idea of the 90s with the complexity of 2020 - just because people cannot handle the simple core concepts of CSS.
[ Parent
| on HN ]
Re:Inline CSS works better in a component world
by marijn on Thursday August 20, 2020 @04:56AM
(#24221288)
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.
Re:Inline CSS works better in a component world
by IfOnlyYouKnew on Thursday August 20, 2020 @05:18AM
(#24221426)
Cascading / 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.
Re:Inline CSS works better in a component world
by lioeters on Thursday August 20, 2020 @02:24PM
(#24226631)
Cascading 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.
Re:Inline CSS works better in a component world
by lioeters on Thursday August 20, 2020 @05:40PM
(#24229342)
Apparently 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.
Re:Inline CSS works better in a component world
by type0 on Thursday August 20, 2020 @06:38PM
(#24229843)
There's also this grouping method to separate classes https://piccalil.li/cube-css/
it's cringe at first but so was BEM and it's still useful even if you combine both
Re:Inline CSS works better in a component world
by herrkanin on Thursday August 20, 2020 @04:46AM
(#24221251)
Huh? This is a direct response for the fact that any sufficiently large vanilla CSS has a high risk to turn into an unmaintainable, monolithic clusterfuck.
Re:Inline CSS works better in a component world
by pocket_titan on Thursday August 20, 2020 @04:51AM
(#24221271)
Did you even read the article? People can handle the "simple core concepts of CSS" just fine - you're interjecting your own pessimistic opinion here & passing it off as fact. No, the article states how the abstraction of CSS classNames doesn't fit well with the idea of using modular Components. You're still writing CSS, heck, styled-components even _adds_ features on top of it. But sure, just keep echoing this "web dev stupid" mentality