logoalt Hacker News

ForHackernewslast Saturday at 9:33 PM5 repliesview on HN

It lets you apply styles to a single element without it messing up the whole rest of the page/site/app. i.e. it disabled the primary feature of CSS, the thing most people don't want from it.


Replies

peacebeardlast Saturday at 9:40 PM

I agree that the primary feature of CSS is what people don't want from it anymore. If you're building your app with components (web components, react, etc), those become the unit of reuse. You don't need CSS to offer an additional unit of reuse, it only complicates things at that point.

show 1 reply
azangrulast Saturday at 9:43 PM

Why do people prefer it over CSS modules? They also solve the style containment problem, and do not require any effort to set up, or any additional library to learn?

show 1 reply
cluckindanlast Saturday at 11:51 PM

Which means most people don’t understand the basics of what they’re working on.

jasonkesteryesterday at 9:15 AM

I think that’s what people are talking about when they say they don’t see the benefit.

There’s already a style attribute on every html element that does exactly that, and works fine in components.

“There must be something more…?” But it turns out there’s not. Just shorthand class names to save you having to type padding-left:4px

show 1 reply
Tade0last Saturday at 9:39 PM

How is that different than inline styles?

show 1 reply