S
S
Sergey750il2017-06-11 22:38:53
Layout
Sergey750il, 2017-06-11 22:38:53

How to change background-image paths in Spritesmith via gulpfile?

Good day. Is it possible to change background image path in mixen via gulpfile?

gulp.task('sprite:build', function() {
    var spriteData =
        gulp.src('src/img/sprite/*.*') // путь, откуда берем картинки для спрайта
        .pipe(spritesmith({
            imgName: 'sprite.png',
            cssName: '_sprite.scss',
            cssFormat: 'scss',
            padding: 2,
            cssVarMap: function(sprite) {
                sprite.name = 's_' + sprite.name;
            },
        }));
    spriteData.img.pipe(gulp.dest(path.build.img)); // путь, куда сохраняем картинку
    spriteData.css.pipe(gulp.dest('src/sass/mixins/')); // путь, куда сохраняем стили
});

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question