gulp-svg-sprites icon indicating copy to clipboard operation
gulp-svg-sprites copied to clipboard

Strips out feDropShadow

Open jlafitte opened this issue 8 years ago • 2 comments

For some reason the output is striping the filter definition I'm trying to use. Here is what I'm trying in the sources SVG:

  <defs>
    <filter id="shadow">
      <feDropShadow dx="4" dy="8" stdDeviation="4"/>
    </filter>
  </defs>
  <circle cx="29" cy="29" r="29" style="fill:#0091ca; filter:url(#shadow)"/>

But what gets created is this:

  <defs>
    <filter id="a"></filter>
  </defs>
  <circle cx="29" cy="29" r="29" fill="#0091ca" filter="url(#a)"></circle>

jlafitte avatar Jun 27 '17 22:06 jlafitte

feDropShadow primitive isn't a part of SVG 1.1 spec, so SVGO removes it. Try to disable removeUnknownsAndDefaults SVGO plugin in config:

svgSprite({
    cleanconfig: {
        plugins: [{removeUnknownsAndDefaults: false}]
    }
})

But be careful: all other unknowns will not be removed too

tomash-als avatar Sep 21 '17 23:09 tomash-als

Better use cleanupIDs: false in this case.

ciases avatar Aug 08 '18 13:08 ciases