插件地址:sprites
gulp.task('sprites', function() {
return sprity.src({
src: './src/images/icon/**/*.{png,jpg}',
style: './_icon.scss',
margin: 20,
orientation: 'left-right',
processor: 'css',
})
.pipe(gulpif('*.png', gulp.dest('./src/images/'), gulp.dest('./src/sass/')))
});
配置了margin:20 生成的background-position位置会不准,设置成margin:0能正常。
It’s normal after adding this. It seems that you need to configure the .hbs template