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

Re: [css-variables] CSS Variables are a NEW kind of variable

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 28 May 2012 09:02:45 -0700
Message-ID: <CAAWBYDC3MJO=ohM-PFbgkr=OhbENLrfTSyE_o2WjnQDBaR2qFw@mail.gmail.com>
To: Thaddee Tyl <thaddee.tyl@gmail.com>
Cc: Fran├žois REMY <fremycompany_pub@yahoo.fr>, Matthew Wilcox <mail@matthewwilcox.com>, www-style@w3.org
On Sun, May 27, 2012 at 4:54 PM, Thaddee Tyl <thaddee.tyl@gmail.com> wrote:
> On Sun, May 27, 2012 at 6:57 AM, Fran├žois REMY
> <fremycompany_pub@yahoo.fr> wrote:
>> It's important to understand that CSS variables are inherited from the
>> parents and are able to emulate some preprocessor-like variables: one
>> variable can be defined at one place, the root of the document, and stay
>> unoverriden everywhere else. The main use-cases of such globals are to allow
>> alternate stylesheets to redefine constants instead of redefining a whole
>> set of css declaration, and to promote the use of easily maintainable css
>> code. Both are pretty important use cases.
>
> It seems to me that there can be many acceptable scope systems.
> Having variables be cross-CSS files seems far from logical to me.
> As a result, I'm not sure anymore of what a global is.

I'm not sure what you're trying to say.

The CSS cascade does not, in any meaningful way, care about where a
value comes from.  Variables, being CSS properties, are thus treated
the same way.

> Also, can we have a system to choose the scope in which a variable is?

Yes, you assign it to an element.  The scope is then the element and
its descendants.

~TJ
Received on Monday, 28 May 2012 16:03:36 GMT

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