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 22:16:02 +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: <1399931337969762@web4e.yandex.ru>
It's a shame. Actually _each_ property could be shortened, especially non-shorthand ones, e.g.:

    background-position => $bp
    font-family => $ff
    line-height => $lh
    word-wrap   => $wr

Why not just expand CSS variables to use them anywhere?
Or at least not just in property values, but in property names too?

What are exact issues with it (if any)?
Why hardly limit the feature (variables in this case) immediately as fast as it's invented?

Thanks.


25.05.2012, 22:04, "Tab Atkins Jr." <jackalmage@gmail.com>:
> On Fri, May 25, 2012 at 10:48 AM, Marat Tanalin | tanalin.com
> <mtanalin@yandex.ru> wrote:
>
>> š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".
>
> No, I don't intend to make that possible. šThere are *very* few
> properties in CSS where one might legitimately want to do that.
>
> In the future, with Mixins, *maybe* let you invoke a mixin based on a
> variable. šBut I'd need a good use-case for it, and that's won't even
> come up until I try working on Mixins again, so that's neither here
> nor there.
>
> (In other words, please don't hijack this thread with mixin stuff.)
>
> ~TJ
Received on Friday, 25 May 2012 18:16:34 GMT

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