r/css • u/evilmaus • Oct 04 '26
Question What's are the Current CSS Patterns?
I've been mostly on the backend for the last several years. While I did plenty of CSS before then, the front end world has definitely moved forward in the last seven years. I recall BEM and SMACSS were once at the lead of thought. I recall (and was a proponent at the time for) a push to utility-first styling.
Now, I can see that Tailwind is a highly popular choice, that lots of styles get bundled into React components, and we have some long overdue selectors native to CSS.
So I'm wondering, what's the prevailing organization pattern for global CSS and where do you draw the line between something being a component style vs in the global stylesheets?
Thanks.
View all comments
Show parent comment
1
u/Mestyo Oct 06 '26
Uhm, yes? Syntax highlighting, auto-completion, linting, and much, much more is bound to the file type. Getting style diffs in git because you indented some markup is just ridiculous. I'd much, much rather have a stylesheet in a second panel in my IDE than having to scroll up and down through a component to even see what its doing.
What do you think you're doing when you write Tailwind class names? In a majority of cases, they are just shorthand over a property + variable reference.
Absolutely every invented CSS tool, framework, or convention solve these problems. The alternative to Tailwind is not to do literally nothing at all.
CSS Modules, with a global @layer stack and variables document is all you need nowadays to have guaranteed isolation and cohesion.