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

Re: Proposal for adding variable declaration blocks

From: Brad Kemper <brkemper@comcast.net>
Date: Tue, 1 Jul 2008 22:20:48 -0700
Cc: David Hyatt <hyatt@apple.com>, "www-style@w3.org list" <www-style@w3.org>
Message-Id: <CDF94E19-58E6-4B90-9096-6E3D7A0725EC@comcast.net>
To: fantasai <fantasai.lists@inkedblade.net>

On Jul 1, 2008, at 4:07 PM, fantasai wrote:

> Another idea:
>  /* http://lists.w3.org/Archives/Public/www-style/2008Apr/0183.html */
>  @define for screen {
>    foregroundColor: blue;
>    backgroundColor: green;
>  }
>  @define boxStyle {
>    border: 3pt solid;
>    padding: 6pt;
>  }
>  @define buttonStyle for screen {
>    border: outset silver;
>    background: silver;
>  }

I like this, except for "for screen". Putting it all in an @media  
screen block should be enough, if you want to limit it to one media  

What I like: It is very simple and easy to remember and use. @define  
is used for different types of variables (singletons or groups), and  
it is the structure that determines how it is used. I like this much  
more than the proposals with multiple names for the various flavors  
(@values, @property-set).

It would also work well if we were to allow re-assigning values to  
existing color keywords (for greater cross-UA consistency, perhaps):

  @define {
    orange: #f60;
    green: #093;

This also very similar in structure to what I proposed for  
@constant[1]. I also had a version for defining selector macros, that  
would look like this if "@define" was the term of choice:
@define navlink( #sidenav ul li a, #topnav ul li a )

[1] http://lists.w3.org/Archives/Public/www-style/2008Feb/0102.html
Received on Wednesday, 2 July 2008 05:21:37 UTC

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