Hacker News new | ask | show | jobs
by embedding-shape 168 days ago
> CSS-in-JS was supposed to free us from global namespace nightmares and styling spaghetti.

That wasn't how "CSS-in-JS" was sold to me, and obviously, does nothing to actually solve that, scoping works the same in CSS regardless if you generate it from JS or not.

The way it was sold to me, was that developers were tired of having to have the styles in a different place than the layouting, and CSS-in-JS would make all of that worth it, even when you consider the performance tradeoff.

I was never sold on it, and continued doing CSS in separate files, mostly following something like BEM most of the time, and still am not affected by scoping issues, and I didn't even need to do the tradeoffs you get when doing CSS-in-JS.