Yeah but only in evergreen browsers once they implement it.. plus now you are making the browser do more work compared to just having simple CSS files that don't have to do complicated things.
"CSS doesn't have to do complicated things" is already a thing of the past. There are plenty of pseudo selectors and custom properties now that can be quite complex.
Which browsers that matter aren't evergreen at this point?
EDIT: got an answer downthread, apparently at least some sites have to deal with old versions of the mobile Safari engine because of old iPhones/iPads that can't be updated and can't run other browser engines. Another good reason to wish that iPhones/iPads permitted other browsers.
The real question is: how many of your users allow the browser to auto update?
This is the most important question nowadays. there are still organizations where this is tightly controlled, they use LTS releases that don't always get the updates as fast or the same etc.
Even LTS releases get much more rapid updates than the upgrade cycle for browsers used to be. I remember stuff getting released in IE8/IE9 and thinking it'd be 10 years before I could properly use it on large customer projects (and I was right pretty much right).
There is no definitive way to answer your question. It depends entirely on your target audience and how much effort your company is willing to put towards support a, I will admit, likely minority. Some of us need to.
I'm genuinely curious to hear which non-evergreen browsers people are having to support. Niche mobile browsers from ancient Android phones? Some of the more obscure mobile browsers from https://caniuse.com/ciu/comparison , or even more obscure ones that aren't listed there?
To what extent are those platforms unable to support a better browser? For instance, Firefox works all the way back to Android 5.0.
I'm genuinely curious to hear which non-evergreen browsers people are having to support.
Browsers on devices (sometimes iPads, sometimes Android) that are inside touch-screen kiosks.
Some of the ones I work with are in places so remote, it would take me three or four days to reach them if a software update goes wrong. Then another three or four days to get back to the office.
While iOS has a quicker update scheme as Android, it's nowhere near as fast as an evergreen browser.
If I look at https://iosref.com/ios-usage there's only half of the users on last year update and 15% of users lagging behind on a 2+ year old browser version.
So expect your average users to have a new Safari version ~1.5 year after it's been out. So the answer to that is no, it's not fast enough to be considered evergreen.
Speed can be optimized over time, particularly as they collect huge real world usage and can optimize for common patterns. That's one unspoken benefit of having features in the browser vs pushing them to build tools.
Its not always appropriate but I feel CSS benefits more often than not for this