Include images like inline in sass without compass?

I want to add images as base64 in sass. I lock on Compass, but it feels bulky and really not what I'm looking for. Is there a way to include images or other files embedded in css without using a compass?

+6
source share
2 answers

If you are using grunt, you can simply use the grunt-data-uri task to achieve a normal url () string conversation with base64.

dataUri: { dist: { src: ['dist/styles/*.css'], dest: 'dist/styles/', options: { target: [ 'img/low-res/embeded/*.*' ], fixDirLevel: true } } }, 

In essence, the task will look for all the images contained inside the built-in folder in your .css. From there, it converts url () to base64.

+3
source

Compass is Open Source, just get the piece of code that suits you.

Here is the source of rubies on Github

+1
source

All Articles