D
D
Denis Bukreev2016-12-30 00:29:05
css
Denis Bukreev, 2016-12-30 00:29:05

How to create multiple sprites in spritesmith?

So it goes.
I needed to have several different sprites in one project, but I can't figure out how to set up a spritesmith for this.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg, 2016-12-30
@denisbookreev

gulp.task( 'sprite', function () {

  var spriteOne = gulp.src( 'sprite/*@1.png' ).pipe( spriteSmith() ),
    spriteTwo = gulp.src( 'sprite/*@2.png' ).pipe( spriteSmith() );

    spriteOne.img.pipe( gulp.dest( 'dest/img/one/' ) );
    spriteTwo.img.pipe( gulp.dest( 'dest/img/two/' ) );

    spriteOne.css.pipe( gulp.dest( 'dest/css/one/' ) );
    return spriteTwo.css.pipe( gulp.dest( 'dest/css/two/' ) );

});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question