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

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

From: François REMY <fremycompany_pub@yahoo.fr>
Date: Fri, 22 Aug 2008 19:37:12 +0200
Message-ID: <867BBC5977DF4C449DB73F364F220D50@fremycompany>
To: "CSS 3 W3C Group" <www-style@w3.org>

> 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
 
Received on Friday, 22 August 2008 17:37:50 GMT

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