- From: Brad Kemper <brad.kemper@gmail.com>
- Date: Thu, 21 Jun 2012 10:49:19 -0700
- To: Florian Rivoal <florianr@opera.com>
- Cc: "www-style@w3.org" <www-style@w3.org>
On Jun 21, 2012, at 8:48 AM, "Florian Rivoal" <florianr@opera.com> wrote:
> On Thu, 21 Jun 2012 17:33:41 +0200, Marat Tanalin | tanalin.com
> <mtanalin@yandex.ru> wrote:
>
>> 21.06.2012, 18:55, "Florian Rivoal" <florianr@opera.com>:
>>> * They can be simulated with variables, so we can live without them:
>>>
>>> For instance, here is a typical example of how they are used:
>>> .icon { background: url(sprite.png) 0 0 no-repeat; }
>>> #a { background-position-y: 0; }
>>> #b { background-position-y: -30px; }
>>> #c { background-position-y: -60px; }
>>> .icon:hover { background-position-x: -30px; }
>>> .icon:active { background-position-x: -60px; }
>>>
>>> This can be rewritten with variables:
>>> .icon { background: url(sprite.png) var(bg-x, 0) var(bg-y, 0) no-repeat;}
>>> #a { var-bg-y: 0; }
>>> #b { var-bg-y: -30px; }
>>> #c { var-bg-y: -60px; }
>>> .icon:hover { var-bg-x: -30px; }
>>> .icon:active { var-bg-x: -60px; }
>>
>> Cannot say for others, but for me first example is much more clear.
>>
>> By the way, very important factor is that background-position-x/-y are supported by IE which is the browser that's updated most slowly. Considering Microsoft's current tactics to release new versions of IE solely for new versions of Windows (no IE>8 for Windows XP, no IE>9 for Windows Vista), IE will continue to update slowly and therefore be painful and blocking new features to be widely used in the wild.
>>
>> So there is huge difference between adding new feature (variables) and reusing existing one (background-position-x/-y) supported in all IE versions. Any non-IE browser will be updated quite quickly, and we could easily start using background-position-x/-y, say, in a year. On the contrary, we will in fact not be able to use variables until they are implemented in IE which updates very slowly unlike any other browser.
>
> If introducing -x and -y didn't prevent us from doing another useful
> thing (logical keywords), then yes, we introducing them would be best,
> which is why I was considering writing a spec for it. But we can't have
> both, and that troubles me.
>
> - Florian
Why not leave background-position-x and background-position-y physical, but let the values they accept depend on writing mode? Thus, if writing mode is vertical, then background-position-x can be head or foot, and if writing mode is horizontal, then background-position-x can be start or stop.
Received on Thursday, 21 June 2012 17:49:57 UTC