Skip to content

Categories:

Spriter: Easy CSS sprites

CSS Sprites are really useful but tricky to maintain, so Craig Smith and I wrote a little Ruby gem to make it much easier to manage them.

Our CSS is now in .spriter files, and using a sprite is as easy as a normal CSS background image:

span.icon {
  -spriter-background: 'icon.png';
}

There’s a Rack middleware that converts .spriter files to CSS and generates the sprite images on request which we use in development, and a few simple methods to create static assets that we use when deploying to production.

If you’re interested you can read more on the Reevoo blog and get the code from GitHub.

Posted in projects. Tagged with , , , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

(required)

(required, but never shared)

or, reply to this post via trackback.