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

Re: [css3] Suggestion: Selector variables or "synonyms"

From: Brad Kemper <brkemper@comcast.net>
Date: Tue, 12 Feb 2008 22:39:53 -0800
Message-Id: <99D37D9B-12E9-440C-A3F6-F6920AFAEAC3@comcast.net>
Cc: www-style CSS <www-style@w3.org>
To: Alan Gresley <alan1@azzurum.com>

On Feb 12, 2008, at 10:27 PM, Brad Kemper wrote:

>> @constant ???( nav, #sidenav, #topnav ) {
>>
>>   ul {list-style: none;}
>>   li (float: left;} /* specificity 1.0.1 */
>>   a {display: block;}
>>   a:link, a:visited {color: black; background-color: yellow; }
>>   a:hover {background-color: black; color: yellow; }
>>   a:active { background-color:black; color:red; }
>>
>> }
>
> I'm not sure what you are getting at here. If it is defining the  
> descendants, that can be done more simply, without the extra  
> brackets. I would do it like this:
>
> /* create constant called MYNAVS and assign selectors to it: */
> @constant MYNAVS( nav, #sidenav, #topnav )
>
> /* now use MYNAVS as placeholders of those three selectors */
> MYNAVS  ul {list-style: none;}
> MYNAVS  li (float: left;}
> MYNAVS  a {display: block;}
> MYNAVS  a:link, MYNAVS a:visited {color: black; background-color:  
> yellow; }
> MYNAVS  a:hover {background-color: black; color: yellow; }
> MYNAVS  a:active { background-color:black; color:red; }

Although, yours is shorter. It just isn't assigning anything to a  
constant or variable anymore, so I wouldn't call it that. Could be  
useful though; so I didn't mean to put it down.
Received on Wednesday, 13 February 2008 06:41:22 GMT

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