W3C home > Mailing lists > Public > www-style@w3.org > April 2014

Re: CSS variable syntax

From: Chris Eppstein <chris@eppsteins.net>
Date: Thu, 3 Apr 2014 08:57:58 -0700
Message-ID: <CANyEp6UYN_uL=Weoe5nR8ckqx3+J9omBw24PKOp0YJrtyjEGXg@mail.gmail.com>
To: Mark Volkmann <r.mark.volkmann@gmail.com>
Cc: Simon Sapin <simon.sapin@exyr.org>, "Jens O. Meiert" <jens@meiert.com>, W3C WWW Style <www-style@w3.org>
On Thu, Apr 3, 2014 at 7:41 AM, Mark Volkmann <r.mark.volkmann@gmail.com>wrote:

> I don't see how referring to them as properties instead of variables
> helps. There is still one syntax for setting them and one for getting them.
> People are going to want to understand why it's good for it to be this way.
> Many will be coming from LESS and Sass where it is not this way.
>

With the recent syntax change I think this is not hard to explain.

You set a property like all properties are set:

--foo: <value>

In css, functions are how you represent a value that is not a literal. E.g.
attr(). So it's not hard to explain why the var() accessor function exists.

var(--foo)

It's the same key in both cases. And seeing as how CSS has already used
almost every special character[1] I can see on my keyboard right now, I
think I'm ok with it not adding another sigil.

Chris Eppstein
Sass Core Team Member

[1]: Only $, &, ?, <, `, and = are left. Note that $ was explicitly
rejected here because CSS custom properties behave so differently from Sass
variables.
Received on Thursday, 3 April 2014 15:58:29 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:21 UTC