Re: [css-variables] Different syntax for variable definition and use

29.08.2012, 22:32, "Tab Atkins Jr." <jackalmage@gmail.com>:
>> ššššš.example {
>> ššššššššš@var {
>> šššššššššššššlink-color: #0d0;
>> ššššššššš}
>> ššššš}
>>
>> ššššš.example A {color: var(link-color); }
>>
>> šand have all inheritance benefits that current CSS-variables draft has, but without confusing `var-`-prefixed syntax for variable declaring: variable name inside `@var` rule and inside `var()` function are _identical_ and thus totally intuitively connected with each other.
>>
>> šWith this scenario, we probably would not need to separate syntaxes for variables as custom properties and variables as macros, we could use same syntax for both.
>>
>> š[1] http://lists.w3.org/Archives/Public/www-style/2012Jun/0060.html
>
> Your proposal is identical to current CSS variables, just with a different
> syntax.

More precisely, my proposal is not just different, it's at least _less confusing_ and _more intuitive_ than current CSS draft: variable name inside `@var` rule and inside `var()` function are _identical_ and thus totally intuitively connected with each other (that's what current thread by Jens is about).

> If we have global variables, if makes sense to take full advantage of
> them, and let them be a full macro mechanism so that you can, for
> example, substitute them into selectors and such.

Why do you consider this impossible?

    @var {
        some-selector: ".example > UL";
    }

    var(some-selector) {
        list-style: none;
    }

Received on Wednesday, 29 August 2012 18:59:47 UTC