#41: CSS Variables
Discussions
Comment by @mnot Apr 23, 2015 (See Github)
Discussed in SF; -- syntax still there. Variables in CSS not easily settable in script. Observing variable changes is difficult. @plinss to write up.
Comment by @torgo Jul 16, 2015 (See Github)
From Berlin f2f: @travisleithead thinks it's fine.
Comment by @slightlyoff Jul 16, 2015 (See Github)
I'd like to note that the lack of an API is disappointing. I know there's work to get it done, but I don't understand the current state and would like to see it prioritized.
/cc @tabatkins
Comment by @tabatkins Jul 16, 2015 (See Github)
Getting/setting API is absolutely there - they're properties, so you just use the normal property API. Because of naming, you can't use the easy style.foo
API, but style.getPropertyValue()
is an old and well-established API.
Observing changes is indeed difficult, and is being addressed in Houdini http://drafts.css-houdini.org/css-properties-values-api/. Getting Variables out the door required keeping it extremely lean; it was the very first extension point CSS had ever grown!
OpenedJan 8, 2015
http://dev.w3.org/csswg/css-variables/