W3C home > Mailing lists > Public > www-style@w3.org > June 2012

Re: [css4-background] background-position-x and background-position-y or logical directions

From: Marat Tanalin | tanalin.com <mtanalin@yandex.ru>
Date: Thu, 21 Jun 2012 19:33:41 +0400
To: Florian Rivoal <florianr@opera.com>
Cc: "www-style@w3.org" <www-style@w3.org>
Message-Id: <596571340292821@web14f.yandex.ru>
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.
Received on Thursday, 21 June 2012 15:34:16 GMT

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