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

Re: [CSSWG] action 38, CSS Variables

From: L. David Baron <dbaron@dbaron.org>
Date: Tue, 8 Apr 2008 12:37:43 -0700
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <20080408193743.GA13740@ridley.dbaron.org>

On Tuesday 2008-04-08 21:14 +0200, Daniel Glazman wrote:
> Daniel had an action item from last CSS WG face-to-face meeting about
> writing a proposal for CSS variables, an oooooold request from the web
> authors' community, and get feedback from that community.
>
> We're then very happy to submit today the following proposal and we hope
> the CSS WG will take it under its wings to make it become a standard
> implemented soon by all browsers. Feedback HIGHLY welcome.
>
>   http://disruptive-innovations.com/zoo/cssvariables/
>
> Daniel Glazman (Disruptive Innovations)
> David Hyatt (Apple, Inc.)

This doesn't say a whole lot about what values are allowed for
variables, which seems like a pretty key part of both how useful
it's going to be and how easy it will be to implement.  It seems
like the range of allowed values has to be rather limited in order
to be represented by the CSSValue DOM interface, though.

In order for user agents to represent a value with the CSSValue DOM
interface, they have to be able to parse it.  This raises the
question, then, of what happens when they're given a value they
don't understand.

The spec needs to answer the following questions clearly:

(1) If a style sheet does:

  @variables { myvar: unknown-keyword; }
  p { color: var(unknown-keyword); }

what happens?  In particular, does the @variable rule exist in the
DOM so that the author can change it to a valid value later?  (This
has a pretty significant effect on forward-compatibility.)

(2) Furthermore, if a style sheet does:

  @variables { myvar: red; }
  p { font-size: var(myvar); }

what happens?  Is the font-size rule ignored temporarily?  And then
if the author uses the DOM to change myvar to "12px", it suddenly
stops being ignored?


I'm worried that issues like these could make this proposal very
hard to implement.

(Has anybody looked into how many of the use cases for variables,
constants, or macros would be addressed by a proposal like this for
dynamic variables with limited syntax, versus a proposal for static
constants/macros with broader syntax permitted?)

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Tuesday, 8 April 2008 19:38:22 GMT

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