Re: [css-variables] do we need to have the CSSVariableMap at all?

Tab Atkins Jr. wrote:
> When you're using "var-" as an author prefix for piping around custom
> CSS properties, rather than using custom properties as variables, the
> ability to iterate the variables on an element is invaluable.

Is it?  Examples of where it would be useful would be good.

> (There are other possible ways to expose this, which are perhaps even
> better - maybe expose a way to query the document for all elements
> with a particular custom property set on them? I'm open to
> reconsidering this.)
>
> Plus, being able to say "el.style.var.foo" is just way more convenient
> than "el.style.getPropertyValue('var-foo')".  It's weird that you have
> to resort to the annoying explicit methods for variables, just because
> they're not camel-caseable like the other properties.

Note that CSSVariableMap as it stands doesn't allow el.style.var.foo, 
only el.style.var.get("foo") etc.

Many people are of the opinion that we shouldn't add new objects with 
named properties too due to it being un-JavaScripty and impossible to 
implement without a Proxy.

Received on Friday, 7 February 2014 00:05:48 UTC