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

Re: [css-variables] status ?

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Fri, 25 May 2012 21:48:51 +0400
To: Tab Atkins Jr. <jackalmage@gmail.com>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>,"www-style@w3.org" <www-style@w3.org>
Message-Id: <939201337968131@web28h.yandex.ru>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:54 GMT