Open Tar-Palantir opened 1 year ago
👋 @Tar-Palantir
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
same to me.
This will help: https://github.com/bubkoo/html-to-image/pull/473
Expected Behavior
I'm trying to get a snapshot of a SVG element that used some SVG
use
.Current Behavior
Above the button is the source SVG image, you can see it have different color. Below the button is the image generated by html-to-image, it lost all custom colors.
Possible Solution
After I debug the libs source code with my code, I found the reason, that is the
ComputedStyle
been set to circle element which is a base element will be used to other places,stroke
andfill
been set tonone
in style, so even thoughuse
element has written those styles to override, but it doesn't work.Steps To Reproduce
Here is a sample code, you can try to convert this to image use
html-to-image
lib.Here is
cloneNode
content that I got by debug. You will find itstroke
andfill
have been set tonone
onpolyline
element.As you see, I should reuse
circle
to draw a line and use it in mask to implement dash effect. So, I can't give a constraint stroke value tocircle
.Additional Context
I think it's a common problem if someone use SVG
use
element to override any style, it should not be worked.Your Environment