Answer the question
In order to leave comments, you need to log in
Gulp spritesmith split into different .css and .jpg folders?
Please tell me how to specify different paths for the sprite itself and css styles! To put them in different folders
, here is this gulp plugin
https://www.npmjs.com/package/gulp.spritesmith
Answer the question
In order to leave comments, you need to log in
var gulp = require('gulp');
var spritesmith = require('gulp.spritesmith');
gulp.task('sprite', function () {
var spriteData = gulp.src('images/*.png').pipe(spritesmith({
imgName: 'sprite.png',
cssName: 'sprite.css'
}));
spriteData.css.pipe(gulp.dest('path/to/output/')); // CSS
return spriteData.img.pipe(gulp.dest('path/to/output/')); // IMG
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question