Hacker News new | ask | show | jobs
by jbreckmckye 331 days ago
I'm a bit of a luddite with CSS. I learned BEM about five years ago and I've more or less always stuck to component scoped CSS files.

Sometimes I use CSS-in-JS if a component system demands it, like Material. I don't mind it as much as others do, I like that there's no CSS concatenation weirdness. But otherwise I feel quite happy with a component file and a style file.

For Tailwind fans (or even detractors), what's the main benefit I'm missing?

2 comments

In my case of many small long running projects with multiple people…

1. Speed - you can get stuff done quickly without making problems globally.

2. Self documenting - both in visibility of html but also because of system/config it forces. People understand to use only values (spacing, sizes, colors) in the config or document that they had to add something and why.

3. CSS specificity is not issue.

4. Performance - straight simple classes are very performant. Complex selectors and pseudo classes can be surprisingly taxing without people realizing it. Thats how functional css started btw

(not sure why I said "five years ago" - I learned BEM back in 2014)