I just found a great feature of Sass / Compass for automatically generating data URIs: the inline data helper.
In my current project we’re using sprites for most of our icon images, but in some cases sprites didn’t work because the element was larger than the icon and other icons were showing through. In these cases we were using standard background images instead of sprites, but this meant we had an extra HTTP request and the hover images weren’t being preloaded.
Luckily Sass came to the rescue!
We simply changed our background image properties from this:
And the result was this:
Data URIs are supported in IE8 and above.