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

Re: [CSS Variables] WebKit now supports variable declaration blocks

From: Brad Kemper <brkemper.comcast@gmail.com>
Date: Fri, 22 Aug 2008 12:52:50 -0700
Message-Id: <2982BEFC-6D0F-4D02-805A-6A16F86799D8@gmail.com>
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: CSS 3 W3C Group <www-style@w3.org>

On Aug 22, 2008, at 10:37 AM, François REMY  
<fremycompany_pub@yahoo.fr> wrote:

>
>> From: "Brad Kemper" <brkemper.comcast@gmail.com>
>>>
>>> On Aug 22, 2008, at 10:16 AM, François REMY wrote:
>>>
>>>> But for complex variables, I suggest the use of a "extends"  
>>>> property.
>>>>
>>>> @define {
>>>>  bigText {
>>>>      font-size: 150%
>>>>      font-weight: bolder;
>>>>      color: black !important;
>>>>  };
>>>> }
>>>>
>>>> h1.bigText {
>>>>  font-size: 15pt;
>>>>  extends: $bigText;
>>>>  color: blue;
>>>> }
>>>>
>>>> Computed values of a "h1.bigText" with no style : {
>>>>  font-size: 15pt; /* the h1.bigText rule have more importance  
>>>> than  the extended one */
>>>>  font-weight: bolder; /* this is the only one rule */
>>>>  color: black; /* the rule that have !important have more  
>>>> important than the others */
>>>> }
>>>>
>>>
>>> I don't see why you would need "extends". The var(varname) or  
>>> $varname should just expand to the same as if you actually typed  
>>> in all the properties yourself. So if you wanted that computed  
>>> value, you would write it like this:
>>>
>>> h1.bigText {
>>>  $bigText;
>>>  font-size: 15pt;
>>>  color: blue;
>>> }
>>>
>>> and that would be the same as if you typed this:
>>>
>>> h1.bigText {
>>>  font-size: 150%
>>>  font-weight: bolder;
>>>  color: black !important;
>>>  font-size: 15pt;  /* supersedes earlier font-size */
>>>  color: blue; /* ignored because of !important */
>>> }
>>>
>
> And if the value of $bigText changes ? How will the browser do if he  
> follows
> your proposal ?
>
> Fremy

Then it's as though that text in the h1.bigText rule changed too. But  
not the order. So the normal specificity would apply as though that  
part of that rule had been edited. 
Received on Friday, 22 August 2008 19:53:38 GMT

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