postcss-data-uri
v1.0.3
Published
PostCSS plugin. Generates inline base64 images in CSS.
Downloads
5
Maintainers
Readme
PostCSS data-uri
PostCSS plugin. Generate base64 images in CSS
.foo {
background-image: data-uri(image.gif);
}
.bar {
background: #fff data-uri(image.gif) no-repeat center center;
}
.foo {
background-image: url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
}
.bar {
background: #fff url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=) no-repeat center center
}
Usage
// Gulpfile.js
gulp.task('process_css', function() {
var postcss = require('gulp-postcss'),
datauri = require('postcss-data-uri');
return gulp.src('*.css')
.pipe(postcss([
datauri
]))
.pipe(gulp.dest('out/'));
});