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 10:30:59 -0700
To: François REMY <fremycompany_pub@yahoo.fr>
Message-Id: <4DA21939-C628-4FFA-837E-1B3A8333EA11@gmail.com>
Cc: "L. David Baron" <dbaron@dbaron.org>, "David Hyatt" <hyatt@apple.com>, <www-style@w3.org>


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 */
}
Received on Friday, 22 August 2008 17:31:38 GMT

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