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

Re: [css-variables] Using $foo as the syntax for variables

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 23 May 2012 09:01:30 -0700
Message-ID: <CAAWBYDCtVqyuAemdmtw2cGnKJ7kGOy6vVXYn=BUPrL2F55BV2A@mail.gmail.com>
To: Brian Kardell <bkardell@gmail.com>
Cc: Sylvain Galineau <sylvaing@microsoft.com>, "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, Brad Kemper <brad.kemper@gmail.com>, www-style list <www-style@w3.org>
On Tue, May 22, 2012 at 6:43 PM, Brian Kardell <bkardell@gmail.com> wrote:
> At the beginning of the thread it seemed that there wasn't a
> definitive example/answer and a few people have commented with some
> variants (like the usage part, but not the declaration part).  Maybe
> having something concrete would help.  Tab -- Are we talking about (I
> don't think so) using exactly this (from Sass site - a):
>
>    $blue: #3bbfce;
>
>    .content-navigation {
>        border-color: $blue;
>    }

Definitely not - that's incompatible with the design of CSS variables,
where they're all tree-scoped.

> Or that would change to something like (b):
>
>    :root {
>         var-blue: #3bbfce;
>    }
>
>    .content-navigation {
>        border-color: $blue;
>    }
>
>
> Or even (c):
>
>
>    :root {
>        $blue: #3bbfce;
>    }
>
>    .content-navigation {
>        border-color: $blue;
>    }

Yes, either of these, though preferably (c).

~TJ
Received on Wednesday, 23 May 2012 16:02:30 GMT

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