Conditional CSS

I like to think of CSS as a conditional design language. Over the years, CSS was known as a way to style web pages. Now, however, CSS has evolved a lot to the point you can see conditional rules. The interesting bit is that those CSS rules aren’t direct (i.e: there is still no if/else in CSS), but the way features in CSS work is conditional.

I never really thought of this, but I like it: there’s no if/else in CSS, but it’s very much conditional. The conditionality of CSS is part of what makes it so much more powerful than today’s design tools like Figma — this is a great image that illustrates that gap.

Also: did you know media queries are actually called “CSS Conditional Rules Module” in the spec? I didn’t.

To me, CSS is like a superpower because it allows me to make so many design decisions through its conditional features. Working with design tools can sometimes feel limiting because I feel like I’m constrained within certain walls. I think that the ability to create conditional rules with CSS is what sets it apart and makes it powerful for web design.