svg-sprite-loader icon indicating copy to clipboard operation
svg-sprite-loader copied to clipboard

Please make it possible to turn off automatically adding ids in <styles>!! It's breaking svg's

Open bencresty opened this issue 4 years ago • 0 comments

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

Using the sprite-loader inline styles like .a { fill: #ff0; } are changed by the loader to #icon-name .a { fill: #ff0; }. This is breaking code here as we use the innerHTML of the <symbol> with the icon. We could add the id to the usage of that innerHTML, but than our HTML would be illegally contain duplicate ids. So that's a no go.

Please add a config setting to prevent altering the selectors inside the <styles> section of a <symbol>!

What is the current behavior?

Automatically ids get inserted in the <styles> selector of a symbol

What is the expected behavior?

No changing of the selectors in the <styles> section when new optional setting is set to false to turn this off.

If this is a feature request, what is motivation or use case for changing the behavior?

See above; we use innerHTML because that's way faster in performance than using <use> in animations. <use> has important cons.

Please tell us about your environment:

  • webpack version: 4.46.0
  • svg-sprite-loader version: 6.0.2

bencresty avatar Apr 26 '21 18:04 bencresty