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 {
... } }


On 6/4/12 5:01 PM, "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
>> 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; }
Received on Tuesday, 5 June 2012 01:02:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC