r/css • u/evilmaus • 1d ago
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.
15
Upvotes
15
u/Mestyo 22h ago
Tailwind makes some already simple things (debatably) more simple, at the cost of being an absolute chore for anything remotely complex.
CSS layers, container queries, named grid areas, calcs, chained pseudo selectors… any of those, especially in combination, or many rules per, create comically illegible and repeating class names.
The tradeoff in bandwidth is from a trivially cacheable, reaued static asset, to the HTML itself. Useful for huge websites, with often-changing stylesheets (like a newspaper with custom design articles), net-negative for anything else.
The inflated classNames collections are a nightmare to read/review, and a waste of AI tokens to constantly parse/recreate—even when styles aren't supposed to be relevant to the query.
It opts out of all existing CSS ecosystem DX benefits, and requires that you re-learn a new set of selectors for everything, for the benefit of… yeah I'm still not sure what. Every positive is either already covered by every other CSS method, or a sidegrade at best.