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

On May 21, 2012, at 2:30 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> I was afraid of switching over because I already know that we want to
> extend the basic usage of variables to, for example, allow providing
> default values.  However, Chris pointed out that this isn't
> incompatible with the $foo syntax.  You could use ordinary variables
> without special abilities like "color: $foo;" but access the extended
> abilities with functions, like "color: var-default($foo, blue);".
> This seems acceptable to me.

So, there is already a magic prefix ('var-') for defining the variable, and now there would be one ('$') for using it too? I don't think I like that, because it feels less like normal CSS to me. Having a function for the value seems like a more normal CSS pattern, and thus, easier to understand and learn. 

> So, since some members of the WG already expressed a desire to see
> Variables switch over to this syntax, are there any strong objections?

I think this would cause trouble to people who use SASS, but still want some variable use in their final, rendered CSS. Also, I don't like the idea of a completely different pattern (functional notation) for similar use combined with a second argument, such as default. 

Received on Tuesday, 22 May 2012 15:16:44 UTC