CSS Classes considered harmful – Keith Cirkel
April 5, 2024
If you’ve ever so much as peeked behind the curtain of Web user interfaces before, you’ll know what the class property is for. It’s for connecting HTML to CSS, right? I’m here to tell you it’s time for us to stop using it. Class names are an archaic system that serves as a poor proxy for your UI primitives, and worse they’re co-opted in awkward ways which results in combinatorial explosion of weird edge cases. Let’s get into it, first with a boring history lesson which you’ve all heard a million times before:
I’ve long been a proponent of using classes to augment the very restricted semantics of HTML. I even wrote as very detailed article of the idea for–what I forgot I did this–A Web Apart, in When? 2009. OK I am officially feeling old now.
But Keith cirkle have other ideas. Keith I’m going to let you finish but…