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

Re: [css-variables] Maintain link between var declaration and use

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 30 Apr 2012 10:19:54 -0700
Message-ID: <CAAWBYDBK0YVAhd4wAJ4GPOd=cguiycb2_s5JkXHeRvZ+CrO7pw@mail.gmail.com>
To: "Jens O. Meiert" <jens@meiert.com>
Cc: www-style@w3.org
On Mon, Apr 30, 2012 at 10:05 AM, Jens O. Meiert <jens@meiert.com> wrote:
>> > In order to align variable declaration and use the format var-* may
>> > suffice, or, as has been proposed in the past, using a special
>> > character to denote variables as in @var-*.
>>
>> Can you elaborate?  I understand what you're saying in the first
>> paragraph, but don't know what you're suggesting in the second.
>
> Yeah, that wasn’t very clear probably. I just played with two possible
> solutions, one being “var-foo” for definition and also “var-foo” for
> usage, the other one being “@var-foo” for definition and “@var-foo”
> for usage. Both solutions would use the same pattern for declaration
> and use though, addressing the original concern.

Ah, got it.

Using a bare "var-foo" keyword for variables wouldn't work unless we
permanently reserved all keywords starting with "var-".  Possibly, but
not ideal.  This also suffers from the same problem that using "$foo"
does - if it's a single token, I can't expand its powers later, such
as adding a default to be used if the var is undefined/invalid.

There's an issue in the draft already about aligning the definition
and use syntax, though the suggestion there is to use "var(foo):
blue;".

~TJ
Received on Monday, 30 April 2012 17:20:43 UTC

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