Skip to content

Instantly share code, notes, and snippets.

@exdeniz
Last active January 4, 2016 14:49
Show Gist options
  • Save exdeniz/8637079 to your computer and use it in GitHub Desktop.
Save exdeniz/8637079 to your computer and use it in GitHub Desktop.
Generate sprite for gulp
Сам плагин для галпа: https://github.com/gratimax/gulp-grunt
Плагин для спрайтов: https://github.com/Ensighten/grunt-spritesmith
module.exports = function(grunt) {
grunt.initConfig({
sprite: {
all: {
src: ['app/img/icons/*.png'],
destImg: 'app/img/sprite.png',
destCSS: 'app/styl/icons.styl',
algorithm: 'binary-tree',
cssFormat: 'stylus',
padding: 1
}
}
});
grunt.loadNpmTasks('grunt-spritesmith');
grunt.registerTask('sprites', ['sprite']);
};
require('gulp-grunt')(gulp, {
prexif: '',
verbose: true
});
// Собираем иконки в спрайт
gulp.task('sprite', function(){
gulp.start('grunt-sprites');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment