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

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