JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.02k stars 273 forks source link

Attributes are missing after <svg> is converted to <symbol> #191

Closed maxmilton closed 7 years ago

maxmilton commented 7 years ago

Do you want to request a feature, report a bug or ask a question? Bug + feature

What is the current behavior? Most attributes on <svg> elements are stripped. Looks like this was fixed for stroke and fill attributes in https://github.com/kisenka/svg-sprite-loader/issues/141 .

What is the expected behavior? At least fill-* and stroke-* attributes should be preserved. There's actually quite a lot of possible attributes that may be desirable to keep so I suggest this be customisable by the developer.

If this is a feature request, what is motivation or use case for changing the behavior? Defining attributes directly on the <symbol> results in smaller file size compared to declaring them on each internal element including on <g>. Allowing the developer to choose what attributes to keep allows for a finer level of customizability.

Please tell us about your environment:

kisenka commented 7 years ago

@MaxMilton sorry for the delay, this shipped in svg-sprite-loader@3.3.0.

maxmilton commented 7 years ago

Thank you very much :heart: