Opinions for Writing Good CSS

June 13, 2024

CSS can be hard and frustrating for beginners. The nature of the language is so different from traditional programming languages. While it’s easy to learn the parts: selectors, properties, etc. It’s much tougher to practically compose multiple ideas together to make something new or more complex happen.

Source: Opinions for Writing Good CSS

I’ve developed in many languages over many many years. Of all those languages the one that is closest to my heart is CSS.
For a language that gives the appearance to everything you see on every web page and web app, it is to be frank criminally under appreciated. We can have a long conversation as to why.

So I have long tried to champion its sophisticated use-not just the output, layout, animation, typography and so on, but the approach to how the code is written and managed.

OOCSS was one of the if not the original widely adopted approaches to a methodology for managing CSS–and way back in 2009 Nicole Sullivan announced this methodology she had been developing to the world at a Web Directions conference. Other approaches followed, BEM, utility-first CSS, as well as a raft of CSS in JS strategies, and of course pre-processors like Sass and LESS to add syntactic and semantic capability (many of these ideas have been making their way into the core CSS language for years now).

But developing a set of heuristics about how CSS is best used is not something you see a lot of, which is what Andrew
Walpole sets out to do here.