CSS variables are go!

In a post I wrote almost a year ago (and in the ensuing comments), I pondered the possibility of someday being able to define variables natively in a CSS document without the use of server-side scripting.

Well it seems that in their most recent nightly build, WebKit has added support for this.

@variables {
    CorporateLogoBGColor: #fe8d12;
}
div.logoContainer {
    background-color: var(CorporateLogoBGColor);
}

I’m not sure if this is based on any particular official CSS3 recommendation or if its something that WebKit has just grabbed and ran with in the hope of it going mainstream, but its certainly a step in the right direction.

1 Response to “CSS variables are go!”


  1. 1 fantasai Jul 3rd, 2008 at 4:47 pm

    Nothing official yet. Hyatt just writes code faster than he writes specs. :) The spec and WebKit will probably morph a lot until the spec stabilizes.

Leave a Reply





Of interest...


No Clean Feed - Stop Internet Censorship in Australia