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

Re: WebKit now supports CSS Variables

From: Håkon Wium Lie <howcome@opera.com>
Date: Tue, 24 Jun 2008 13:49:59 +0200
Message-ID: <18528.57191.10904.515555@opera.com>
To: David Hyatt <hyatt@apple.com>
Cc: www-style list <www-style@w3.org>

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?

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.

I'd prefer to throw away invalid declarations at parse time, and not
have to keep them around. Therefore, I suggest that we add text
similar to the @namespace specification:

  The namespace prefix is declared only within the style sheet in
  which its @namespace rule appears. It is not declared in any style
  sheets importing or imported by that style sheet, nor in any other
  style sheets applying to the document.

  http://www.w3.org/TR/2008/CR-css3-namespace-20080523/

Cheers,

-h&kon
              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Tuesday, 24 June 2008 11:51:06 GMT

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