- From: Tab Atkins Jr. <jackalmage@gmail.com>
- Date: Fri, 25 May 2012 11:04:21 -0700
- To: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>
- Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, "www-style@w3.org" <www-style@w3.org>
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:05:14 UTC