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

Re: CSS variable syntax

From: Mark Volkmann <r.mark.volkmann@gmail.com>
Date: Thu, 3 Apr 2014 11:11:11 -0500
Message-ID: <CAFfRWnWsuD4ScE6i2TO5HF5HGmFgPwgtU41RMk+zxrW81JgN1g@mail.gmail.com>
To: Chris Eppstein <chris@eppsteins.net>
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 10:57 AM, Chris Eppstein <chris@eppsteins.net> wrote:

> 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.
>

I'm not familiar with what @ is being used for. Why couldn't variables
start with @?

Why would it be difficult to implement this so that --foo in a property
value means get the value of the foo property, making var(--foo)
unnecessary?

-- 
R. Mark Volkmann
Object Computing, Inc.
Received on Thursday, 3 April 2014 16:11:43 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:39 UTC