W3C home > Mailing lists > Public > www-style@w3.org > February 2011

Re: CSS Variables

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 7 Feb 2011 10:38:43 -0800
Message-ID: <AANLkTimf85+NWghrLB7yCXX1Phm24p_Xa7pdpuoYEnF6@mail.gmail.com>
To: Christof Höke <csad7@t-online.de>
Cc: www-style list <www-style@w3.org>
On Sun, Feb 6, 2011 at 3:37 AM, Christof Höke <csad7@t-online.de> wrote:
> What is wrong with the syntax proposed at
> http://disruptive-innovations.com/zoo/cssvariables/ you referred to?
> @variables {
>    foo: red
>    }
> bar {
>    color: var(foo)
>    background: var(foo) url(x.gif) no-repeat;
>    }

The @variables block with multiple declarations inside doesn't allow
easy annotation with types, which we think is useful.  That's about
the only difference.

> would not introduce any new syntax/grammar, just a new @-rule and a new
> value "function". The ``$foo`` would change the parsing rules of CSS, would
> it not?

It's not a significantly greater change than adding a new function
that's valid everywhere, afaik.  Note that using the $ prefix is still
perfectly friendly with the forward-compatible syntax - it just looks
like an invalid value to downlevel UAs.

> Adding a syntax to the spec would be good just to prevent different syntaxes
> in different preprocessors currently available (if they use a CSS like
> syntax at all).

Heh, I don't think we can stop preprocessors from doing what they
want.  People get the craziest ideas sometimes about what sort of
syntax makes sense.

That said, the SASS people are amenable to adding the official syntax
we agree on to their preprocessor, either through their existing SCSS
syntax mode or through a new mode.

Received on Monday, 7 February 2011 18:39:36 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:43 UTC