CSS variable constants :-)
By glazou on Saturday 29 March 2008, 00:41 - CSS and style - Permalink
Web authors, rejoice... I accepted an action item to write a short note about variables in CSS. The syntax will NOT be something readers should comment on. Basically it's a mechanism to define a variable and be able later on to use that variable as the value of a property or in the list of values of a property. It's also a mechanism to change that variable from script. It's not a macro, not a constant, it's more a "CSS variable". Once I have released this note, we'll need feedback from the web authors community based on use cases and, again, not commenting on the syntax. Basically, to make this happen, we need an editor for the spec (done), use cases to prove this feature is not only desired but needed, and of course two implementations... Of course, we also need Selectors Level 3 to be out in the wild and we need spare cycles. Stay tuned!
Update: sorry for the member-only URL. Not sure really why a list of suggested extensions for CSS 3 is member-only when all the contents of that doc comes 100% from public feedback... Anyway, I updated the link.

Comments
Wow.. lots of great news from the CSSWG.
Maybe it's time to push position: new again!
http://daniel.glazman.free.fr/weblo...
I'm very interested in this. I wanted to see the page you linked but an account is needed.
I've done a Xaraya CMS back office theme using php to manage variable in my css stylesheet and I would be interested in testing with CSS variables.
variables constants?
Surely that is an oxymoron?
"Sorry, Password Required." Excellent.
P. S. Just interesting: *why* we'll can't comment syntax?.. Web developers are who really know what they need, and, I'm convinced, that process need to be open completely.
Great news.
I don't suppose these variables can also be used as conditionals? Similar to the following:
@define theme = "dark";
@if[theme="dark"] {
@define bg = "#000";
@define fg = "#fff";
} else {
@define bg = "#fff";
@define fg = "#000";
}
@dis: please read the two last lines of CSS 1 spec Appendix E : http://www.w3.org/TR/REC-CSS1#appen...
For me it looks like the "chainon manquant" between js or programming languages and css !! Of course, that would meen to be able to manage those "variable constants" with javascript...
(sorry I don't know the translation for that expression)
Here's a good case: when you have a (several) brand colour(s) that you have to mention several times in numerous lines, and considering how cryptic #nnnnnn can be, I would love to be able to have variable for colours (and maybe even font sizes, who knows) and to reference them each place where they were repeated.
I'm sure authoring CSS's would be much less painful