News for hackers. Stuff that matters.
Re:CSS sprites shouldn't add production time (and 4 other tips) by TheThomas on Monday November 30, 2009 @02:24PM (#968474)
The transparent spacer image hack seems horribly antiquated to me. I'm surprised anyone still does it that way.
Re:CSS sprites shouldn't add production time (and 4 other tips) by railsjedi on Monday November 30, 2009 @09:32PM (#969121)
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.
Re:CSS sprites shouldn't add production time (and 4 other tips) by fnid on Monday November 30, 2009 @03:12PM (#968567)
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.

Re:CSS sprites shouldn't add production time (and 4 other tips) by rriepe on Monday November 30, 2009 @03:22PM (#968601)
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?

Re:CSS sprites shouldn't add production time (and 4 other tips) by lucumo on Monday November 30, 2009 @06:25PM (#968930)
> 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.

Re:CSS sprites shouldn't add production time (and 4 other tips) by fnid on Tuesday December 01, 2009 @01:55AM (#969368)
Yes, a complete end to end would be nice.
Re:CSS sprites shouldn't add production time (and 4 other tips) by pmichaud on Monday November 30, 2009 @03:55PM (#968657)
If you're using photoshop it's really easy to automate the creation of the sheet. Dealing with the coordinates is just a matter of using the right conventions and sticking to them.
Re:CSS sprites shouldn't add production time (and 4 other tips) by rubyrescue on Monday November 30, 2009 @04:27PM (#968729)
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?
Re:CSS sprites shouldn't add production time (and 4 other tips) by rriepe on Monday November 30, 2009 @05:08PM (#968814)
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.

Re:CSS sprites shouldn't add production time (and 4 other tips) by dmv on Monday November 30, 2009 @05:37PM (#968861)