Re: [css-variables] status ?

Could you clarify is it supposed to made it possible to use variable as property _name_ to make useful things like this?

    /* Defining 'bp' variable as alias for 'background-position'. */
    :root {var-bp: background-position; }

    /* Using compact $bp as property name instead of long 'background-position' */
    .foo {$bp: center; }

As I've said before in this thread [1], making defining syntax same as reading one can cause ambiguity like "whether declaration containing $-prefixed property name is variable _definition_, or the $-prefixed property name should be replaced with value of a variable defined before".

[1] http://lists.w3.org/Archives/Public/www-style/2012May/0782.html

Thanks.


25.05.2012, 20:38, "Tab Atkins Jr." <jackalmage@gmail.com>:
> On Fri, May 25, 2012 at 9:31 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>
>> šAnyway, yeah, here's a summary of what changes I'd like to make:
>
> And of course, I forget one.
>
> 6. (Optional, but desirable.) šChange the syntax for *defining* a
> variable from "var-foo" to "$foo" as well. šThis resolves the issue
> that's been in the draft for a while where people want the definition
> and use of a variable to use parallel syntax. šThis one does require a
> Core Grammar change, but it's compatible with our forward-compatible
> error-handling. š(#1 might also want a grammar change so we end up
> with a VAR token instead of a DELIM + IDENT pair that we then
> interpret as a variable in the parser, but it's not necessary.)
>
> ~TJ

Received on Friday, 25 May 2012 17:49:21 UTC