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

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

From: Francois Remy <fremycompany_pub@yahoo.fr>
Date: Tue, 29 Jul 2008 12:02:16 +0200
Message-ID: <5C537C33F854443AAFD8DA203DD70412@FremyCompany1>
To: "David Hyatt" <hyatt@apple.com>, <www-style@w3.org>

For me, a complex variable is not a variable but an inherited set of rule.
So it should not be defined in a @variables block (in a @define block, why 
not, but it's a little confusing though).

As I said before, I much prefer a syntax like :

    @style-set styleSetName {
        width: 5em; height: 5em;
    }

    div {
        extends: styleSetName;
        /* or */
        imports: styleSetName;
        /* or else */
        inherits: styleSetName;
    }

As a compromise, we can do something like :

    @define {
        styleSetName: {
            width: 5em; height: 5em;
        }
    }

    div {
        extends: $styleSetName;
    }

--------------------------------------------------
From: "David Hyatt" <hyatt@apple.com>
Sent: Tuesday, July 29, 2008 12:56 AM
To: <www-style@w3.org>
Subject: [CSS Variables] WebKit now supports variable declaration blocks

>
> In the next WebKit nightly you will be able to try out CSS variables 
> whose values are declarations.  Here is what the syntax looks like:
>
> @-webkit-variables {
>    simpleVariable: 5px;
>    complexVariable {
>        width: 5em;
>        height: 5em;
>    }
> }
>
> div {
>     background-color: green;
>     -webkit-var(complexVariable);
>     color: white;
> }
>
> As I stated in a previous post, WebKit also currently supports the  double 
> equals syntax and the dollar sign syntax for referencing  variables, so 
> =complexVariable= and $complexVariable also work.
>
> dave
> (hyatt@apple.com)
>
> 
Received on Tuesday, 29 July 2008 10:02:58 GMT

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