W3C home > Mailing lists > Public > www-style@w3.org > May 2009

Re: Sprites (was: Background position)

From: Sophie <sophie.gousset@laposte.net>
Date: Tue, 19 May 2009 10:55:04 +0200
Message-ID: <4A1273E8.2020104@laposte.net>
CC: www-style@w3.org


I like the logic of this proposal. The resulting markup would be rather
light and I think easier to read than position coordinates.

If I follow you on this track, I would add an optional 'clip' series of
coordinates to be able to mask the rest of the image when you assign it
to an area bigger than the sprite you want to use (tab icons with text
for example). You then wouldn’t need to space the sprites in the image
file, or use extra markup to clip the sprites.

@sprite <id> {
     sprite-image: <image>;
     sprite-offsets-x: <number>+;
     sprite-clip-x: <number>+;
     sprite-offsets-y: <number>+;
     sprite-clip-y: <number>+;

sprite(<id>, <x-index>, <y-index>) would refer to the x and y offsets
list, the clip indexes wouldn’t be used outside of the @sprite rule.


| S O
| P H-                http://sophie-g.net/
Received on Tuesday, 19 May 2009 08:55:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:26 UTC