Created
August 13, 2015 09:34
-
-
Save cikoriicabachkov/363d5c692baedd2a0012 to your computer and use it in GitHub Desktop.
Postcss-sprites example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var postcss = require('gulp-postcss'); | |
var sprites = require('postcss-sprites'); | |
var opts = { | |
stylesheetPath : './dist', | |
spritePath : './dist/images/sprite.png', | |
outputDimensions: true, | |
padding : 10 | |
}; | |
gulp.task('css', function () { | |
var processors = [ | |
sprites(opts) | |
]; | |
return gulp.src('./src/*.css') | |
.pipe(postcss(processors)) | |
.pipe(gulp.dest('./dist')); | |
}); | |
gulp.task('default', ['css'], function () { | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
PostCSS plugin that generate sprites from your stylesheets and then updates image references.