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

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 UTC