News for hackers. Stuff that matters.
Re:Show HN: Smooth UI, a React UI Library for Humans by madeofpalk on Monday May 28, 2018 @04:39PM (#17174702)
The core premise for CSS in JS is to work around CSS's global namespace. It means you can write styles for a component using a 'local namespace' and have to worry a lot less about accidentally affecting the styles of other parts of your site. Every other language has scoping, so why can't CSS?

This is especially helpful as your site and team scales - you don't need to worry as much about stepping on other people's toes, nor do you need to be as aware of the entire (styling) scope of your website. When you do share/cascade/compose/extend styles, it makes it a lot more explicit in the way you do it.

It's basically taking a concept like BEM and baking it into the language, reducing the mental overhead.

There are no comments on this comment yet.