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

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

From: Jonathan Camenisch <jonathan@camenischcreative.com>
Date: Tue, 29 May 2012 15:39:12 -0500
Message-ID: <CANkPBgaSHGQeoxSdxhd4z6pw_LYTx7Gisz5+sF1sh_xeujQD+g@mail.gmail.com>
To: Brian Kardell <bkardell@gmail.com>
Cc: Florian Rivoal <florianr@opera.com>, www-style@w3.org
> > I'm not there yet, but if it were to go that
> > way, I'd get over it.
> Speaking for myself at least, I feel the same way in the other
> direction.  I don't find $ (on the left at least) better in any way
> and advocate for var-* (or set-* or user-* or data-* or any number of
> potential names) for reasons I and others have already expressed.
> That said, if it went that way, I'd get over it.  The idea is more
> important to me than the specifics and I like the idea as drafted
> _much_ more than most of the previous attempts.

Agreed. Cascading variables will open up exciting possibilities. (even if
we have to wait several years to take advantage, etc., etc.).

>  You just need to use SASS so you can feel the
> > elegance. :)
> They potentially do something fundamentally different, you will be
> able to express things that it would be impossible to express in SASS
> and vice-versa.

I've read others make a point along these lines, and I'm not sure it's been
answered yet. I don't see how any differences between SASS and CSS relate
at all to var-, $ or any other syntax. The $ in SASS simply starts the name
of a variable. It doesn't say anything about the scope system that's
available in SASS. The way variable scope works in SASS arises from the
situation of it being preprocessor. The way variable scope will work in CSS
is very intuitive in the context of CSS. Coming from SASS or any other
language, and seeing `$foo: bar` in CSS would never make me think, "that
must be global," or "that must be local to the file," or anything else
about scope. I would probably think, "That looks rather like a variable. I
wonder how CSS handles those." From there, I could easily guess and confirm
with slight trial and error that CSS variables respect the cascade.

If you're referring to something other than scope, maybe I'm missing it. To
me, the proposal sounds like variables. If it's something fundamentally
different than that, we should avoid the use of "var" to name it.

I also wouldn't suggest it is only about taste or aesthetics, but as far as
I've noticed, all the objective reasons for var- have been objectively
debunked. But one's observation of that may well be influenced by one's
"aesthetic" perspective (including all manner of background in various
tools, languages, and the accompanying cultures). Indeed, the subjective
perspectives of the community overall are of objective value in the end,
since a big goal is helping humans communicate and reason about complexity
with the greatest possible clarity and ease.
Received on Tuesday, 29 May 2012 20:39:58 UTC

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