- From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
- Date: Wed, 29 Aug 2012 22:59:16 +0400
- To: Tab Atkins Jr. <jackalmage@gmail.com>
- Cc: Jens O. Meiert <jens@meiert.com>,"www-style@w3.org" <www-style@w3.org>
29.08.2012, 22:32, "Tab Atkins Jr." <jackalmage@gmail.com>: >> .example { >> @var { >> link-color: #0d0; >> } >> } >> >> .example A {color: var(link-color); } >> >> and have all inheritance benefits that current CSS-variables draft has, but without confusing `var-`-prefixed syntax for variable declaring: variable name inside `@var` rule and inside `var()` function are _identical_ and thus totally intuitively connected with each other. >> >> With this scenario, we probably would not need to separate syntaxes for variables as custom properties and variables as macros, we could use same syntax for both. >> >> [1] http://lists.w3.org/Archives/Public/www-style/2012Jun/0060.html > > Your proposal is identical to current CSS variables, just with a different > syntax. More precisely, my proposal is not just different, it's at least _less confusing_ and _more intuitive_ than current CSS draft: variable name inside `@var` rule and inside `var()` function are _identical_ and thus totally intuitively connected with each other (that's what current thread by Jens is about). > If we have global variables, if makes sense to take full advantage of > them, and let them be a full macro mechanism so that you can, for > example, substitute them into selectors and such. Why do you consider this impossible? @var { some-selector: ".example > UL"; } var(some-selector) { list-style: none; }
Received on Wednesday, 29 August 2012 18:59:47 UTC