W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css-variables] Putting it all toegether (syntax)

From: Peter Sorotokin <psorotok@adobe.com>
Date: Mon, 4 Jun 2012 18:01:29 -0700
To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
CC: CSS 3 W3C Group <www-style@w3.org>
Message-ID: <CBF2A7BA.236CB%psorotok@adobe.com>
Seems like pretty nice syntax to me. Just do the next step and allow
@variables { ... } on the top level being the same as :root { @variables {
... } }

Peter

On 6/4/12 5:01 PM, "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
wrote:
>[snip]
>> That @variables rule is exactly identical to a normal style rule in
>> mechanics.  You avoid the need to put a prefix on your var names, but
>> in return are forced to put a prefix on your selector (the @variables
>> token and the parens), and probably have to repeat selectors that
>> you're already using to apply normal styling properties.
>
>We are forced to repeat selectors multiple, multiple times again and
>again everyday for more than 10 years, so apparently it's not considered
>a serious issue by CSS WG. And repeating selector in @variables rule is
>not something that could make situation any worse.
>
>For the rest, it may (or may not) make sense to consider using @variables
>at-rule inside regular rules:
>
>    .example {
>        @variables {
>            link-color: red;
>        }
>    }
>
>    .example A {color: $link-color; }
>
>[snip]
Received on Tuesday, 5 June 2012 01:02:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT