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

On Thu, Feb 6, 2014 at 2:42 PM, Cameron McCormack <> wrote:
> Hi,
> I'm wondering whether we need to have the CSSVariableMap at all.  What does
> it make easier that you can't do by interacting with the declaration object
> itself?  To look up and set individual variables, you can do
> decl.setProperty("var-x", "something") and decl.getPropertyValue("var-x").
> The CSSVariableMap would make it easier to get an iterator for the
> variables, but I'm struggling to see when you'd want to do that.

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.

(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 "" is just way more convenient
than "'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.


Received on Thursday, 6 February 2014 23:58:12 UTC