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

RE: [Css Variables] Variable Declaration Blocks

From: Mike Wilson <mikewse@hotmail.com>
Date: Tue, 30 Sep 2008 09:14:37 +0200
Message-ID: <BAY116-DAV1A1E690B71840D8886434A4430@phx.gbl>
To: "'David Hyatt'" <hyatt@apple.com>, "'Anne van Kesteren'" <annevk@opera.com>
Cc: <www-style@w3.org>
Message-ID: <003b01c922cc$326a4d70$0a01a8c0@mikedeskxp>

David Hyatt wrote:
> Anne van Kesteren wrote:
> > Mike Wilson wrote:
> > > The discussion in the meeting notes
> > > http://lists.w3.org/Archives/Public/www-style/2008Sep/0075.html
> > > was kind of brief regarding some of the technical problems with the
> > > original CSS Vars suggestion.
> >
> > Well, the CSSOM problem is significant.
> What problem?
> You can relax the one-value-per-property-per-declaration-block rule  
> when dealing with variable declaration blocks.

Hi David,

Anne hasn't replied back yet on what he sees as the main obstacles in 
CSSOM, but is your above mention of "one-value-per-property-per-
declaration-block" what you think could be one of them?
Excuse me if getting this wrong, but in the below example would that
problem be that complicatedVariable, instead of having "one" value, 
contains an extra block level with property assignments?

  @define { 
    simpleVariable: green; 
    otherSimpleVariable: blue;
    complicatedVariable { 
      background-color: red; 
      color: blue; 

If that is indeed the problem, maybe that could be resolved by a small
adjustment to the syntax:

  @define { 
    simpleVariable: green;
    otherSimpleVariable: blue;
  @define complicatedVariable { 
    background-color: red; 
    color: blue; 

Ie, a @define without an identifier makes a simple variable from each
child, and @define with an identifier makes one complex variable from
the whole declaration.

> it's not difficult to envision how 
> the CSS OM for them might work.

Yes, I also think it would be quite possible (and desired) for CSSOM to 
reflect this in a nice way, especially considering CSSOM being far from 
REC. But we would really need to hear from Anne about this.

I would think the question should be about how to best integrate
variables with the "core" of CSS, rather than look for problems in the
current API whose aim is to reflect it.
But maybe I am missing something? (quite probable)

Best regards
Mike Wilson
Received on Tuesday, 30 September 2008 07:15:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:39 UTC