- 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>
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 UTC