On disliking new CSS features

I've come to realize that, when a new CSS feature is in the works, my initial reaction is often "do we really need this?"

Recently, I stumbled upon a post from Christopher Kirk-Nielsen about the new (to be implemented) if() feature in CSS. Previously, I also read Lea Verou's post on the very same topic about a year ago (in fact, Lea played a huge role in getting this feature in shape). My initial reaction, in both cases, is one of dislike; I'm pretty happy with the state of CSS right now, and don't feel like we need to add much more.

This is not a feeling specific to if(); I get on the same rollercoaster with every major CSS feature (except for nesting, that one was awesome from the get-go). For example, I had the same initial reaction reading about cascade layers (written by Miriam Suzanne). But now, I think cascade layers are great, and I use the feature in almost all of my projects.

CSS is already complex

The reality is, CSS is really hard to do well. Even many industry veterans are still looking for better ways to write CSS. The mental model and understanding of how the way CSS structures everything is very important to writing maintainable stylesheets. In my (admittedly somewhat limited) experience working with other front-end developers, I noticed a general lack of understanding for CSS, and a desire to "just get it to work". I feel that adding CSS features will only amplify its complexity, and only create more people that want things to "just work" rather than do things well and have a thorough understanding of what they are doing. Presumably, this desire for simplicity is a driving factor in Tailwind's popularity.

Learning a new feature

In a way, a new CSS feature is a lot harder to learn than, for example, a new JavaScript feature. For example, let's say JavaScript gets a new array method; I just learn that, and only that, and I know how it works. I don't need to think about how it can interact with other array methods, or anything else. If I understand its semantics in isolation, I understand it in general. With CSS, this is not the case. You can understand absolute positioning in isolation, you can understand flexbox in isolation, but what if you absolutely position a flex item? Who knows what happens then! In a way, I feel that when a new CSS feature drops, I not only have to learn the feature by itself, but also how it interacts with every other feature.

I love the CSSWG

It should be said that I'm extremely thankful for, and look up to, all the people making CSS better. I personally love CSS, but I also recognize it as being (at least for me) the more difficult language out of the HTML-CSS-JS trio. I want to make it clear that this is not a rant to say "the CSS working group sucks!" because I feel the absolute opposite to that. It is merely a bit of self- (and CSS-)discovery.