Re: CSS Variables

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.

~TJ

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