W3C home > Mailing lists > Public > www-style@w3.org > June 2008

Re: WebKit now supports CSS Variables

From: David Hyatt <hyatt@apple.com>
Date: Tue, 24 Jun 2008 12:40:37 -0500
To: Håkon Wium Lie <howcome@opera.com>
Cc: www-style list <www-style@w3.org>
Message-id: <D1137F1A-B9A9-4126-AEBD-96E75B278489@apple.com>

On Jun 24, 2008, at 6:49 AM, Håkon Wium Lie wrote:

> Also sprach David Hyatt:
>
>> http://disruptive-innovations.com/zoo/cssvariables/
>
> Variables in CSS has often been requested by authors and perhaps it's
> time to add this to the language. There are are concerns, however,
> about the scope of the variables. The current proposal says:
>
>  The definition of variables crosses @import boundaries.
>
> If they cross @import boundaries, why should they not cross from one
> linked style sheet to another?
>

They do.  Any variable is globally defined and usable by any  
stylesheets in the document (the way I implemented it at least).

> Still, it may be simpler and better not to allow any such crossing.
> Take for instance this example:
>
>  style sheet 1: @variable { X: 10px }
>  style sheet 2: @variable { X: none }
>  style sheet 3: div { width: var(X) }
>
> Style sheet numbering is in document order. If the
> fininshed-loading-order is: 3, 1, 2, the width declaration would first
> be invalid ("The declaration becomes invalid if the variable does not
> exist") then valid with 10px, and then invalid again when X is none.
>

In WebKit at least, the parsing of the declaration with the variable  
call is delayed until all stylesheets have been loaded (we don't show  
any content in WebKit while stylesheets are still loading).

dave
Received on Tuesday, 24 June 2008 17:41:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:07 GMT