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

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 UTC