CSS variables on the horizon

By Nicholas Rougeux, posted on April 9, 2008 in CSS, Web

Apple and Disruptive Innovations submitted a proposal today for CSS variables and I'm excited to see this first step taken. Having the ability to define variables in CSS is something I and just about every other designer have wanted for quite some time.

Apple, Inc. and Disruptive Innovations expect CSS Variables to receive a very positive feedback from both the Web authors' community and browser vendors

Daniel Glazman, <Glazblog/>

I hope so. The CSS landscape would change drastically if this goes through all the way. It's doubtful there would be any visual changes to the web in terms of design, but the learning process and maintenance would be greatly impoved.

Combined with the proposed calc() function in CSS3 in lieu of nasty JavaScript expressions, CSS is inching closer to becomming a programming language (using the term very loosely). Variables and calculations have been talked about for a while and while workarounds have been done, they usually involve server-side programming mixed with CSS which doesn't always work out as planned.

I like the one comment on Broken Links that described it as "a style sheet for your style sheet." I've created similar things on sites like Children's Memorial Hospital along with a few upcoming sites and while I feel that what I've done is efficient I'd love to see how much better I could make them with variables and calculations.

There's still a long way to go, but this is a good start.

« Back to blog