Closed liho00 closed 3 years ago
My current solution is svgSpritePlugin({ symbolId: (name) => "icon-" + name, removeAttrs: [] }),
removeAttrs set as empty array, and then manually go to the svg file remove only the width and height attributes on the svg tag.
Hi @liho00 I'm not sure if removing just the width and height of the SVG tag will cause new problems, so I plan to expose a function that lets users handle the elements themselves. What do you think
Hi @liho00 I'm not sure if removing just the width and height of the SVG tag will cause new problems, so I plan to expose a function that lets users handle the elements themselves. What do you think
Removing the width and height attributes Tag isn't a problem and is correct (hence the SVG width & height can be controlled by class and style), I also encourage to do so. However, it shouldn't remove the inner Tags with width and height attributes.
I think it is only necessary to fix the removing function, which only removes the width and height attributes of the SVG tag, other tags shall not be affected.
Now just remove the width and height from the root element. At the same time, I added the transform option. We can modify elements more freely
Well done sir!
current behavior: I understand that height and width attributes are removed by default on the svg tag, Its correct.
Expected behavior: However, I got image tag inside the svg tag, the width and height attributes are removed by default. The missing of the inner width and height attributes caused the svg broken. So, i think we should only remove the width and height attribute only on svg tag instead of all width and height attribute in the svg file.