

CSS Variables are here - sant0sk1
http://ajaxian.com/archives/css-variables-are-here

======
ajross
Not to be too snarky: but what feature of CSS variables can't be emulated just
as cleanly with a little jQuery? There is always going to be a spectrum
between "style" and "behavior" attached to elements, and it strikes me as much
more productive to try to solve the problem at the level of a programming
environment instead of a no-longer-quite-as-static-as-originally-envisioned
style description language.

~~~
Hexstream
Doesn't jQuery require client-side javascript? If so that precludes its use
for crucial parts of CSS in my mind.

Hasn't anyone thought of implementing a "static" version of jQuery that makes
modifications at compile-time on the server?

~~~
twism
ycfeeds.com uses server-side jquery and (although ycfeeds.com does not do it
much) can manipulate dom styles and add class names to elements using CSS3 at
"compile time".

~~~
omouse
How does server-side jquery work? Are you running it through Rhino or
SpiderMonkey or some other javascript implementation before it hits the
client?

~~~
twism
Rhino, using John Resig's "env.js"

~~~
omouse
Awesome. Thanks :D

------
jawngee
I posted about this before on HN, but I've implemented CSS variables using PHP
as an intermediary. This implementation is coded to the same spec that webkit
is using, so the stylesheets will be usable once more browsers support it. You
can peep it here:

<http://interfacelab.com/variables-in-css-via-php/>

Probably pretty easy to port to another runtime.

------
ashleyw
Cool! Though, this will be one of those features which is only useful in years
to come when Firefox 4 and IE9 supports it, sadly. But once it has a wide
audience it will be an amazing feature!

~~~
jamesjyu
Agreed. But alas, I hate it when these features are announced, because they
will only tease me for years to come until it's widely released.

------
gcv
I read somewhere that the W3C originally didn't want to do this because it
deemed that CSS shouldn't become a programming language. Ten years of
nightmarish style sheets later...

~~~
alabut
This change definitely won't make it a programming language - they're not even
real variables, they're more like XSLT's definition of variables. Also known
as constants.

------
KevinMS
CSS variables also here

<http://moonfall.org>

------
bprater
Long overdue. But it's good to see it implemented!

------
TweedHeads
Great!

They will make my life easier.

Only if HTML implemented the same concept, one can dream.

