S
S
Sergey2017-03-04 17:47:25
css
Sergey, 2017-03-04 17:47:25

Why do gradients disappear in SVG sprite?

I generate an svg sprite in Gulp using gulp-svg-sprites with the standard task:

gulp.task('sprites', function () {
    return gulp.src('app/i/icons/*.svg')
        .pipe(svgSprite())
        .pipe(gulp.dest("app/i"));
});

At the same time, the gradient of the icons flies, which they have when they are individually. All of them are filled with the color of the icons that come first in the file. What could be the reason for this, I'm not strong in svg and I don't even know where to dig.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2017-03-04
@Hando

Due to the fact that your gradient is made through the class. And for different icons, the class names can intersect and, accordingly, overwrite each other. Open svg in notepad and edit class names to be unique.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question