Hacker News new | ask | show | jobs
by meerita 2411 days ago
> I think utility-first CSS has its benefits as well as it's drawbacks

What drawbacks?

1 comments

You add a class called font-bold which adds a bold style to the element. Your client decides the element should be italic not bold. You then have to go back and change all your bold elements to use font-italic.
That's not a drawback at all. First, you would replace those font-bold with font-italic (assuming you name the utilities like that) and problem solved. You don't need to change .font-bold and add font-style: italic; in the font-bold class. That's they convinience of utilities: they aren't mutable.
What if you have 500 pages which need to have font-bold replacing with font-italic? Or more? 1000 pages?

Sure, you can probably write a script but if you name your elements semantically, you potentially only have to change it once.