gulp-imacss ![Build Status](https://camo.githubusercontent.com/d4434b4b6178d39764abf7f5bb3a99a86faace63b10301b9110576f066b88d4f/68747470733a2f2f7472617669732d63692e6f72672f616b6f656e69672f67756c702d696d616373732e706e673f6272616e63683d6d6173746572)
imacss (the image to datauri to CSS transformer) plugin for gulp
First, install gulp-imacss
as a development dependency:
npm install --save-dev gulp-imacss
Then, add it to your gulpfile.js
:
var imacss = require('gulp-imacss');
gulp.task('imacss', function () {
gulp.src('./images/**/*.svg')
.pipe(imacss('images.svg.css'))
.pipe(gulp.dest('./build/'));
});
You're are also able to do something different before piping it to imacss
:
var svg2png = require('gulp-svg2png');
var imacss = require('gulp-imacss');
gulp.task('imacss', function () {
gulp.src('./images/**/*.svg')
.pipe(svg2png())
.pipe(imacss('images.png.css'))
.pipe(gulp.dest('./build/'));
});
In this case the result would be first a transformation from SVG to PNG images and then the production of the CSS file images.png.css
.
Type: String
Default: undefined
Name of the CSS file that should be generated, e.g. images.svg.css
.
Type: String
Default: undefined
Namespace of the CSS classes.
Copyright 2014 - 2015, André König ([email protected])