haithembelhaj / sass-inline-svg

node-sass function that inlines SVG files
22 stars 22 forks source link

changeStyle function doesn't inline styles #12

Open PatrickRose opened 5 years ago

PatrickRose commented 5 years ago

For reasons that I don't understand, we've got an SVG that is something like:

<svg>
    <path style="fill:pink" d="{snip}" />
</svg>

Calling inline-svg with something like {"path": {"fill": 'black'}} will end up setting the fill property on the path element, but because there's a style attrib that ends up taking priority.

Not 100% sure on how best to fix it - though I imagine it's probably best to also check the style tag for the attrib in question?

PatrickRose commented 5 years ago

A similar thing will happen if if there's a <style> definition.