Re: WebKit now supports CSS Variables

>

On Jun 24, 2008, at 1:36 PM, David Hyatt wrote:

> This isn't really covered in the spec, but WebKit preserves variable-
> dependent values as unresolved in the CSS OM.  So progressive
> rendering (were we to do it) would even still work.  I don't see the
> problem.  If the variable is initially undefined, you preserve the
> property/value in the CSS OM with an unresolved value, and if at any
> time you can later resolve it (when new stylesheets load) you do.


It is related to a suggestion I privately submitted in April in  
response to the 1.0 document (http://disruptive-innovations.com/zoo/ 
cssvariables).

I think there would be a real use in having a new 'undefined' keyword  
as legit variable value.
- From a legibility standpoint, it would allow to declare in a single  
place all the variables that will be used throughout the web site,  
making it clear that the 'undefined' ones will be assigned later on  
by script or in other stylesheets.
- From a development standpoint, it would allow a script to reset a  
valid variable to the 'undefined' state, therefore reverting the  
corresponding properties to their default value, and possibly back  
later to a valid set value, without having to do the underlying  
cleanup and error handling that might be required by 'removeVariable'.

Pierre

Received on Friday, 4 July 2008 08:53:25 UTC