tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.28k stars 1.68k forks source link

Svg CSS style `fill` prop is not applied for icons (svg use) #254

Open wclr opened 5 years ago

wclr commented 5 years ago

Use case: description, code

The dom is rendered almost perfectly fine, but there are some problems with svg icons rendering

So I have somethin like this:

.inactive-con svg {
  fill: #CCC
}
<span class="inactive-icon"><svg><use...></svg></span>

Expected behavior

Icon rendered would be the same color as in DOM: #CCC

Actual behavior (stack traces, console logs etc)

Icon svg fill is not applied.

Browsers

Any advice on this?

aravind14feb commented 5 years ago

I'm facing this problem as well. Were you able to resolve this?

Also, did you make any alterations in the framework to make svg use tag work. Because I had to write a workaround to get it working.

wclr commented 5 years ago

@aravind14feb No I didn't make any changes, I have lots of svgs on the page, the problem only with that I described. If you find out how to make it work, it would be cool, I didn't get in to the sources.

adamma1024 commented 3 years ago

@tsayen What's the progress about this problem?

bliitzkrieg commented 1 year ago

@wclr did you find a solution to this?