I’ve realized something obvious again, this time about CSS; that CSS wants to be a system. At the core of CSS is a series of cascading rules and classes marrying and mingling in an elegant symphony of style application. Dozens and dozens of declarative instructions for painting pixels on the screen come together in under a millisecond. Sometimes it creates magic, other times it creates memes.
At its core, CSS wants to be a system and – besides its quirky selector power ranking algorithm – it doesn’t come with one out of the box. CSS wants you to build a system with it. It wants styles to build up, not flatten down. It even has layers as a feature! You can start small with a minimalist reset or satisfy your inner typenerd with a typographic default and build up from there. You can make your own reset. You can establish your own naming convention. You can decide to nest or not. You can use IDs. You can use only-classes. You can even dip a toe into the Shadow DOM if you crave the dark arts. Hell, I encourage you to use !important
just to feel something.
Not everyone wants to conduct that symphony and I understand that. A nice thing about that CSS is that it’s sharable! Plenty of pre-built systems exist to let you offload that skill. Through the magic of copy-and-paste, you too can have high quality design! But don’t mistake a shortcut as the only valid option. We as humans and technologists like to compare objects and declare winners – to be kingmakers! – but it’s a mistake to shop at only one store and only eat meatballs despite the ubiquitous appeal of Scandinavian design.
CSS wants to be a system and it’s not an impossible task to make your own. Will there be mistakes and bad assumptions? Yeah. Will there be a junk.css
file? Probably. Will you commit CSS crimes? Indubitably. Is CSS just thousands of key-value pairs with random collisions implemented in an uneven distribution among a handful of different browsers? It sure is, but I wouldn’t have it any other way.
In all my years of programming I have never loved a language more than CSS. There’s no other programming language that sparks my brain and lights up my imagination like CSS. Even after thirty years, there’s a rush of adrenaline when I see a complex design and I wonder “How am I going to make that happen?” which leads me to “And how am I going to make that happen on a phone and older browsers?” That’s the fun part of the job. And it’s good to know that there are other people out there who are great at CSS, people who can build up and tear down these systems with ease, people I can siphon knowledge from and build up my own skills when a new challenge arises.
So cheers to the CSS folks, the tinkerers. Your obsessive animations, pixel pushing, and system building – both delicate and strong – are fun to see and experience.