Re: [css-variables] CSSVariablesDeclaration interface definition

Tab Atkins wrote:

> > Ah, I think I get it now.  So the following examples below would
> > be valid/invalid as described:
> >
> >   div {
> >     var-foo: 16px;
> >     var-Bar: red;
> >     var-foo-bar: 50%;
> >   }
> >
> >   el.style.var.foo = "30px";       // valid
> >   el.style.var.Bar = "blue";       // valid
> >   el.style.varFoo = "50%";         // invalid - camel-cased var props not supported
> >   el.style.varfoo = "16pt";        // invalid - as above, irrespective of casing
> >   el.style.var.foo-bar = "red";    // invalid - not valid JS ident syntax
> >   el.style.var["foo-bar"] = "red"; // valid
> >
> > Are these variations correct?
> 
> Yes.
> 
> > I think it would be really helpful to have a section 4.3 with examples
> > of this sort to illustrate common usage patterns.
> 
> Thanks for the examples!  I copied them into an example in the spec. ^_^

So those may be examples of valid/invalid variable formats but it
would be nice to have "real" examples precede that, including some
sort of "iterate over all variables" one.

John

Received on Friday, 1 March 2013 05:36:26 UTC