

CSS sprites shouldn't add production time (and 4 other tips) - rriepe
http://matchstrike.net/strikepad/2009/11/5-things-you-might-not-know-about-css-sprites/

======
TheThomas
The transparent spacer image hack seems horribly antiquated to me. I'm
surprised anyone still does it that way.

------
railsjedi
Cool library I've been working on (still early in dev, but I'm using it to
generate production assets): <http://github.com/merbjedi/sprite>

It's a ruby executable (no ruby knowledge required to use it though) that
easily generates sprite files and css from a directory structure. It defaults
to something sane, but you can overwrite it via config/sprite.yml

Install it via:

    
    
        gem install sprite
    
    

Then run it via:

    
    
        sprite
    

Check out the README to learn how to configure. If anyone knows their way
around ImageMagick on the command line, please msg me on github (merbjedi).
Would love your help on 4 lines of RMagick code I need to get converted so I
can remove this dependency.

------
fnid
These are good tips, but it doesn't eliminate the additional production time
required to use sprites. You still have to combine all the images into one,
then take time to position them where you want.

The tips speed up production with sprites, but it's still faster to produce
sites without using sprites.

~~~
rriepe
If you're combining images into one at any point, then there's probably a
better way to do it. If you design from the beginning with CSS sprites in
mind, you should always be working from your spritemap image. Then it's a
matter of time spent positioning vs. time spent managing the images themselves
in your document, which I've found to be pretty even.

I really didn't touch on this as much as I would like in the post. Would a
process post on this be of interest to you?

~~~
lucumo
_> Would a process post on this be of interest to you?_

It would to me. I have some interest in CSS sprites, but working with them
always seems cumbersome.

------
rubyrescue
is there a tool (preferably a rails plugin or gem, or rack middleware, but
hosted web service would be fine too) that will take images linked to in a
site's css and auto-sprite them, fixing up the css at the same time?

~~~
rriepe
There's several: Google "CSS sprite generator"

I'd categorically recommend against all of them, however. I feel it's a better
practice to manage it yourself. Of course, if you need to convert multiple
sites fast, they might be worth a try.

