Answer the question
In order to leave comments, you need to log in
What is wrong with adding svg?
Unable to style svg
My gulp to build sprites
gulp.task('svgstore', function () {
return gulp
.src('app/svg/parts/*.svg')
.pipe(svgmin(function (file) {
let prefix = path.basename(file.relative, path.extname(file.relative));
return {
plugins: [{
cleanupIDs: {
prefix: prefix + '-',
minify: true
}
}]
}
}))
.pipe(svgstore())
.pipe(rename({basename: 'sprite'}))
.pipe(gulp.dest('app/svg/build'));
});
<svg class="icon">
<use xlink:href="/svg/build/sprite.svg#facebook"></use>
</svg>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question