Open snelsi opened 1 year ago
@qq15725 Sorry, but your fork doesn't handle svg symbols, if they are defined outside of the target element:
This makes it pretty much unusable for my use-case ☹️
Well, now it does 😄 see Import Map
Oh, wow. Blasting speed! Will definitely try it later today 👍
Looks like the original color issue still occurs. Can't reproduce it in a playground, though. But I keep getting wrong colored icons in my application
Consider the following html:
It should generate two buttons, one with red icon and one with yellow icon:
But in the resulting image both icons are black:
Expected Behavior
Symbol Icons with
currentColor
should inherit color of the parent component where they are used.Current Behavior
Svg symbol is inserted in the place where it's used, but the color of the body element is hardcoded in it's inline styles.
Possible Solution
Add an exception for this case here: https://github.com/bubkoo/html-to-image/blob/b751cbf212ccc7909077bc105b0630f9c845389a/src/clone-node.ts#L202