W3C home > Mailing lists > Public > www-style@w3.org > May 2012

RE: [css3-variables] review comments on latest draft

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Tue, 22 May 2012 15:07:40 +0000
To: John Daggett <jdaggett@mozilla.com>, www-style list <www-style@w3.org>
Message-ID: <3C4041FF83E1E04A986B6DC50F0178290A354820@TK5EX14MBXC262.redmond.corp.microsoft.com>

[John Daggett:]
> 
> > The valid possible values of a variable property are almost completely
> > unrestricted. 

Arron loves to write testcases for anything 'almost completely unrestricted' :)

More seriously this sentence seems both confusing and unnecessary given what 
follows, which is the clear normative part. John, any example(s) of your concern?

> >
> > A declaration that is invalid at computed-value time results from
> > either using an invalid variable in a property value, or using a valid
> > variable that produces an invalid declaration when it is substituted
> > in. When this happens, the declaration must compute to the property's
> > initial value.
> 
> This ends up changing CSS semantics in some fairly subtle ways which I
> think you should explicitly note.  Specifically, invalid declarations with
> variables behave differently from invalid declarations without:
> 
> /* without variables */
> 
> p        { color: blue; }
> p > span { color: 3px;  }  /* invalid ==> color == blue */
> 
> /* with variables */
> 
> :root    { var-span-color: 3px; }
> p        { color: blue; }
> p > span { color: var(span-color); }  /* invalid ==> color == black */
> 

This is both subtle and surprising. Why shouldn't/can't it be blue?
Received on Tuesday, 22 May 2012 15:08:43 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT