The only reason I use any utility classes is because CSS still doesn't support Mixins.
-
The only reason I use any utility classes is because CSS still doesn't support Mixins.
Utility classes are bad code smell. They mean someone at either a semantic or content level is trying to invoke styling at an atomic level instead of a context level.
No-one entering content into a web system or who's job is wrangling semantics should be doing any atomic styling.
We have classes so people can go "this content should be presented as bannerStyle1".
Not: "use this red on this span".
-
If the tables were turned, and designers were writing code who's styles just injected hundreds of otherwise identical columns in your MySQL database in order to achieve a design "simply", you'd have a fit. You'd say it was wrong. Inefficient. Bloated. Unreadable later.
And if the style people said "eh, it's an abstraction, who cares? My design tool just compiles that away and actually it's more optimal" you'd feel gaslit.
Guess what?
Guess. What.