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

Re: [css-variables] Variables used without prefix or function

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Mon, 28 May 2012 15:14:01 +0200
Message-Id: <982FEDEA-55C4-4847-9271-42BF304EF5DF@crissov.de>
To: www-style list <www-style@w3.org>
Tab Atkins Jr. (2012-05-24):
> I don't see what the benefit to the author is of making variables be simple keywords.

It’s the easiest of all syntaxes.

> This would make it hard to spot variables in use, as they look just like every other keyword.  

With counters or font families you have the same problem, which is none.

> It would make it confusing to combine with other keywords.

Keywords are confusing as they are, because there are so many different types of them which aren’t explicitly distinguished anywhere. Adding user-defined variables into their “namespace” doesn’t make it any worse, because we already do so elsewhere.

> It introduces the need for precedence rules which mean that *sometimes* an ident is a keyword and other times its a variable.

Yes. I tried to explain that it hardly ever matters and if it does people are doing it on purpose. most of the time.

> This suggestion has a lot of bad usability problems, and the benefit is that you can omit a single character (the $ prefix).

I think enough argument have been brought up against the ‘$’ prefix, but saving a few characters, i.e. “var(” and “)”, to type is not the main benefit. The main benefit, actually, is usability, because authors could use variables just the same as anything else they use, including stuff they defined themselves (counters, fonts, pages …).

> This seems pretty easy to reject.

Of course, for a programmer, if they don’t take a minute or two to think about it.
Received on Monday, 28 May 2012 13:14:34 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:16 UTC