CSS is Broken: My Dime a Dozen Opinion
The latest web development shitstorm on Twitter has been “CSS is broken”. To no one’s surprise, this has provoked heated discussions on the perceived flaws of CSS, and what can be done to “fix” what’s “broken” in the language. Here’s my opinion, such as it is.
This assessment is not unique, and I’m certain it’s been made in one form or another long before I deigned to write this little screed, but there’s value in repainting the picture. We each exist at some point within this incredibly broad spectrum of ability and talent. We’re going to feel more or less comfortable about different technologies, libraries and frameworks based on where we exist on the spectrum. Moreover, our experiences influence our development preferences.
So when I hear developers say that “CSS is broken”, I only hear frustration. These people are asking for features to make CSS seem less broken to them. Encapsulation and scope are the usual gripes I read about, that CSS is inherently flawed because everything exists in the global scope.
This is flat out wrong. CSS is intentionally global in scope because it is up to you to define the scope that makes the best sense for your site. That doesn’t make it broken. It means that you don’t understand CSS well enough to make it work properly for you. The wide open nature of CSS means that it can be as encapsulated or as global you need it to be.
CSS isn’t the problem. The problem is that it’s a difficult and nuanced language that’s changing more rapidly now than it ever has. That causes frustration. Frustration instills all sorts of negative feelings from aversion to self-loathing. Frustration is the problem.
Thank you to Keith Grant for looking over this post and giving his feedback. Check out what he has to say on this topic, too.