You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It takes your PNG’s, chews them up and spits out sprites!
point bin/css-spriter at a directory, and watch it sprite away!
CSS-Spriter uses Chunky PNG for it’s PNG manipulation. Not only is it super fast, but the library is a great example of fast, efficient ruby programming.
Chunky PNG is written in pure ruby, this means you can sprite up anything using MRI, JRuby, or Rubinius.
If you point the sprite command at a directory tree by default it will construct sprites for each of the sub directories and generate a single css to access all of the sprites which is placed in the root of the directory tree
CSS-Spriter assumes all of your sprites are located in the directory public/images/sprites. This directory should contain sub-directories for each sprite you wish to create. The css class names for an image in a sprite will take the form <directory_name>_<image_name>. Here is an example:
Running the sprite:generate task does all the work. Each sprite directory (cars, planes) will now contain a sprite.png. Spittle will also generate a sprites.css stylesheet in public/stylesheets/ that you should include in your layout. If you wished to use the ford image from the cars sprite you would give the ‘cars_ford’ class to the desired element in the view. That’s it!
Check out examples/sprites if you want to see what CSS-Spriter can do without doing any work.