Yes, CSS is code

Learning from "The Humble Border-Radius"

One of the best things I overheard at the Fluent Conference was (more or less):

“CSS live coding? I was like, that isn’t code. But then it was.”

Lea Verou had changed the mind of a skeptic.

CSS is not Turing complete (Update: Lea points out that I’m wrong about that), and I’ve long been grateful that it wasn’t designed as an imperative programming language. It can be too much code for designers, too little code for programmers, and yet it’s code.

I think about the graphics work I tried to do with shapes and sprites and assorted kinds of vectors over the years, and then watch this keynote. Even with the glitches and coming improvements she notes, it’s clear that whatever tools I was using at the time, they weren’t declarative enough. (I’d also just seen this JSFest talk on CSS box-shadow by Vince Allen, so I was looking forward to more CSS graphics magic.)

Some of my favorite moments include:

  • “He looks like a character out of a children’s book because pretty much every developer doesn’t think he’s cool. I’m here to prove you wrong.” [at 0:12]
  • Browsers will work out ratios if the details aren’t right. [1:20]
  • Making an ellipse [3:00]
  • Many more shapes and options for buttons [5:38]
  • Adding transitions and animations [at 6:19]
  • Mixing shaped boxes with content: the future with shape-inside [at 7:07]
  • Where browsers disagree: reporting CSS to JavaScript [at 8:13]
  • Browser-corner-shape coming soon, and trick with gradients now [at 10:40]

You might also want to explore an older but much longer version of this talk from CSSConf. You can also see Lea’s keynote from last year on “Everything You Always Wanted to Know About Web Standards”, and an interview she gave on regular expressions at Fluent 2012.

tags: , ,