Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a library to do CSS spriting automatically?

CSS Spriting can really help performance, but it's not the easiest thing to read and maintain. Are there any tools that would let me code the images individually but aggregate them up and replace the HTML with the correct subset of the montage?

I'm specifically thinking a Ruby on Rails plugin, but if there's a package for another language, I'd be happy to port it.

like image 382
James A. Rosen Avatar asked Feb 23 '09 01:02

James A. Rosen


People also ask

Are image sprites still used?

Image sprites are used in numerous web apps where multiple images are used.

How do CSS sprites work?

CSS Sprites are a collection of images that are combined into a single file that an HTML document can access. These images are then called into use within the HTML code to be displayed on the website.


2 Answers

SmartSprites

Try it.

like image 89
Warrior Avatar answered Oct 18 '22 06:10

Warrior


I haven't tried it, but image_bundle appears to be what you want:

http://github.com/bartt/image_bundle/tree/master

like image 25
kingryan Avatar answered Oct 18 '22 05:10

kingryan