W3C home > Mailing lists > Public > www-style@w3.org > February 2014

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

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 07 Feb 2014 11:05:15 +1100
Message-ID: <52F4233B.9080107@mcc.id.au>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: www-style list <www-style@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:18 UTC