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

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

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Thu, 6 Feb 2014 16:18:49 -0800
Message-ID: <CAAWBYDBkmeRJN0qwU9n=g7eev2+O2H9yse++56+FjRBdot8Y8g@mail.gmail.com>
To: Cameron McCormack <cam@mcc.id.au>
Cc: www-style list <www-style@w3.org>
On Thu, Feb 6, 2014 at 4:05 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> 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.

Let me put some thought into this.

>> (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.

Oof, you're right.  Yes, it's still less convenient then. :/

(I'm also of that opinion.)

Received on Friday, 7 February 2014 00:19:36 UTC

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