FWeinb / grunt-svgstore

Merge svgs from a folder
MIT License
920 stars 94 forks source link

Remove with #134

Closed roblevintennis closed 6 years ago

roblevintennis commented 6 years ago

@FWeinb @jonathantneal Hi there!

It's been a while, but, I'm a returning contributor (I did some of the currentColor stuff for fills and strokes). I'd like to add some more useful functionality!

We have a designer who takes to using a "bounding box" in Sketch, and this adds a path to the output SVG. We'd like to allow the raw SVG to preserve the bounding box path, but strip those from the production "SVG Sprite" definition that grunt-svgstore generates.

In order to achieve this, this pull request adds a removeWithId option which, when supplied with a value, allows particular SVG elements to be removed, as described in my bounding box use case.

jonathantneal commented 6 years ago

Great work! This looks really clean. I’ll let the tests complete, and merge this if they have passed.

roblevintennis commented 6 years ago

awesome thanks @jonathantneal :)

roblevintennis commented 6 years ago

Btw, my designer "convinced me" this was a thing by pointing me to material designs icons at https://github.com/google/material-design-icons/tree/master/action/svg ... looks like they generate design/production directories with only difference being that first path bounding box: https://raw.githubusercontent.com/google/material-design-icons/master/action/svg/design/ic_3d_rotation_24px.svg

What we're doing here seems much nicer ... just one /svgs directory where the designer can import/export without any hand "adding back" of their bounding box...so I'm a bit excited for that :)