Gulp plugin for creating SVG sprites.
npm install gulp-svg-mixer
const gulp = require('gulp');
const mixer = require('gulp-svg-mixer');
gulp.src('img/*.svg')
.pipe(mixer())
.pipe(gulp.dest('build'));
Type:
string
Default:classic
See svg-mixer.spriteType for details.
Type:
string
Default:'sprite.svg'
Name of generated sprite file.
Type:
string
Default:'sprite-styles.css'
Name of generated CSS file.
Type:
string
Default:'.[symbol-id]'
CSS selector for generate symbol styles. [symbol-id]
will be replaced by
actual symbol id.
Type:
boolean
Default:true
Generate aspect ratio CSS styles.
Type:
boolean
Default:true
Prettify SVG and CSS output.
const gulp = require('gulp');
const mixer = require('gulp-svg-mixer');
gulp.src('img/*.svg')
.pipe(mixer({
sprite: { type: 'stack', filename: 'stack-sprite.svg' },
css: { selector: '#[symbol-id]' }
}))
.pipe(gulp.dest('build'));