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

Re: [css3-images] Extending Jorrit's sprite proposal to irregular coordinates

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 24 Jul 2009 08:01:33 -0500
Message-ID: <dd0fbad0907240601i63d3788cme9dda6163a653b6b@mail.gmail.com>
To: Aryeh Gregor <Simetrical+w3c@gmail.com>
Cc: www-style list <www-style@w3.org>
On Fri, Jul 24, 2009 at 5:59 AM, Aryeh Gregor<Simetrical+w3c@gmail.com> wrote:
> On Thu, Jul 23, 2009 at 10:21 PM, Tab Atkins Jr.<jackalmage@gmail.com> wrote:
>> After some more thought since January, I like Jorrit's sprite
>> proposal[1].  It solves the problem of defining sprites in a single
>> location quite well, so if you need to adjust the positioning of the
>> sprites you need only make a change in one place.
>>
>> However, it fails to address sprites that are spaced irregularly on a
>> grid.  This can happen if one has multiple dissimilar images they are
>> trying to sprite, such as the Google image Jorrit references[2].
>
> Can't we just require for simplicity that the sprites be evenly
> spaced?  If they're different sizes, the author can choose a spacing
> large enough to fit the largest.  I assume the extra stretches of
> empty space wouldn't add noticeable filesize.

The problem with that is that you end up with sprites that you still
have to chop down, because they include all the empty space around
them.  Ideally once you introduce a sprite, it is *exactly* identical
to the individual image you would have used.

Another alternative would be to just declare several @sprite blocks,
all referencing the same source image but setting up their offsets
differently.  That can be a bit overkill for cases where you only have
one or two irregular regions, though.

~TJ
Received on Friday, 24 July 2009 13:02:28 GMT

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