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

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 UTC