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

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

~TJ

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