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

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

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Sun, 27 May 2012 17:15:38 +0400
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-Id: <2084361338124538@web7e.yandex.ru>
Indeed, it may make sense to clearly separate two things and their syntaxes:

1. variables that are just replaced to _strings_ they hold -- like in preprocessor. @variables at-rule definition-syntax and $-prefixed access-syntax could be used for them and only for them;

2. variable _values_ with cascading like in the current CSS-variables draft. They could be defined as `value-foo: bar` and accessed by straightforward and nonconfusing `value()` function, not `var()` or `$`.


27.05.2012, 12:26, "François REMY" <fremycompany_pub@yahoo.fr>:
> The thruth has to be told about "using the $foo syntax for css variables":
> the whole thread clearly show that people are completely failling to see the
> whole point of cascading variables. And if we continue toward that
> direction, people will likely never understand it anytime soon (I speak
> about the usual web developper, not the few ones that read and understand
> the essence of specifications).
>
> To summarize, we have :
> - people asking to be able to use $foo anywhere (even in selectors, property
> names)
> - people asking to not have to use :root for setting variables and asking
> for @variables instead
>
> People are excited to reuse, for css variables, a syntax used in many
> programming and templating languages to do preprocessor work (echo "xxx $foo
> xxx" in PHP, dir $folder in Bash, ...) because this is what they expect from
> CSS variables. They expect them to do preprocessor work. Have you seen a
> voice outside this working group asking publicly for cascading variables?
> No, because most people haven't heard of that, and aren't likely to
> understand its implications. We're developing CSS variables in expectation
> of HTML Components, Shadow DOM and many things people are not yet
> understanding, because they simply don't exist at this time.
>
> The decision to make the css variables like css properties is what brought
> css variables to life in this working group, what brought so much excitment.
> This idea is really disruptive, this is a bold move and one I truly love.
> However, since we've introduced the idea of the $foo syntax and asked the
> community to show support for it, more and more people are asking to remove
> all that css variables uniqueness (an incredibly useful feature) and just go
> the SASS/Bash way.
>
> The problem is outlined by Stephen Wolfram in a review-of-reviews of his
> latest book :
>
> [...] if people think something is a small idea, they’ll try to understand
> it by straightforwardly extending what they already know. And when that
> doesn’t work, they’ll just be confused. On the other hand, if you
> communicate up front that something is big and important, then people will
> make the effort to understand it on its own terms—and will much more readily
> be able to place and absorb it [...] --
> http://blog.stephenwolfram.com/2012/05/living-a-paradigm-shift-looking-back-on-reactions-to-a-new-kind-of-science/
>
> I'm seriously asking the question: are there any kind of variables existing
> out there who work like the CSS variables? If there's no, maybe it's worth
> stopping to think about what currently exist and try to use a syntax that
> best define the new kind of variable we're trying to define, not a syntax
> that best fit to the currently existing kind of variables.
Received on Sunday, 27 May 2012 13:16:10 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT