dom-to-image icon indicating copy to clipboard operation
dom-to-image copied to clipboard

Gradient color not properly exported

Open stevdza-san opened this issue 2 years ago • 2 comments

First I want to say thank you for making this library, it's quite useful. :) I've experience a strange result while trying to export an element colored in gradient(two colors). The image that I've exported is not the same as the one I have on my page. The exported one, looks like a single color, and not two color gradient. I'm using FileSaver lib for image exporting btw.

Element on my website: 11

Exported Image: pretty-ko

stevdza-san avatar Feb 15 '23 14:02 stevdza-san

@stevdza-san 我按照下面的方式可以正确导出渐变色,你可以试下,希望对你有用

image

渐变色的样式写在内层元素gradientContent身上,即不要直接写在ID元素上

wsl0520 avatar Jun 01 '23 09:06 wsl0520

Hi @wsl0520, that did not work for me. Created an inner element with the gradient styles and still the exported image is in a solid color. Do you have any other ideas on how to fix this?

Nderim1 avatar Jul 10 '23 06:07 Nderim1