Re:In Defense of Utility-First CSS (2018)
by welly on Saturday November 16, 2019 @05:29PM
(#21555365)
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.
[ Parent
| on HN ]
Re:In Defense of Utility-First CSS (2018)
by meerita on Sunday November 17, 2019 @06:08PM
(#21560666)
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.
Re:In Defense of Utility-First CSS (2018)
by welly on Tuesday November 19, 2019 @06:55AM
(#21572186)
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.