3 ms·
>could be handled by a simple tool that generates CSS. Not quite. Check the bits about changes to the DOM interfaces. You can get and set variables via Javas
by IsaacSchlueter 18y ago
>could be handled by a simple tool that generates CSS.
Not quite. Check the bits about changes to the DOM interfaces. You can get and set variables via Javascript, and the styles of the page will all update as a result. That's powerful and useful.
It is a bit of a slippery slope. But it's hardly as bad as expression() ;)
Variables don't change the fundamental nature of CSS as a declarative rule-based language, and in my opinion at least, it's a pretty good fit.
But it also doesn't address the biggest problems with CSS. I wrote about 5 of them here: http://foohack.com/2007/10/top-5-css-mistakes/ http://foohack.com/2007/10/top-5-css-mistakes/ but I forgot the worst one of all. The 12 billion keywords. I'm not sure how that would have been done differently, since any declarative language is bound to have a big vocabulary, but I've seen so many novice webdevs struggle with remembering what does what. A good editor with auto-complete helps, but it's still a pain.