Dom-to-image: when using -webkit-background-clip: text with background image image background not rendered

Created on 11 May 2017  路  14Comments  路  Source: tsayen/dom-to-image

Use case: description, code

I have a div with this style:
-webkit-text-fill-color: transparent;
background: #edbc8e;
background-image: url(fondo.jpg);
-webkit-background-clip: text;

Expected behavior

It should render the masked text background on the canvas

Actual behavior (stack traces, console logs etc)

But it doesn't. If I use a gradient like
background: linear-gradient(to bottom, #3c332b 0%,#2f2820 49%,#352f27 100%);
it works, but not with an image.

Browsers

  • [ ] Chrome 49+

Most helpful comment

Hello, is there anyone who has found a solution to this issue?
I suspect it's got something to do with the vendor prefix since the domtoimage.toPng works perfectly on Firefox, but not on Chrome.
Would be highly appreciated if someone knows how to fix this issue. Thank you in advance!

All 14 comments

if im using on a div:
background-image: linear-gradient(90deg, $backColor 50%, transparent 50%, transparent), linear-gradient($nextdeg, $barColor 50%, $backColor 50%, $backColor);

its not rendering it, you maybe know why?

I am having this problem, but only in Chrome.

Fiddle https://jsfiddle.net/2m8dcr63/405/

Left = screenshot / Right = output of dom-to-image on Chrome Version 68.0.3440.106
clip_test

.clipText { color: transparent; -webkit-text-fill-color: transparent; background-clip: text; -webkit-background-clip: text; background-size: cover; background-image: url(../img/forest.jpg) ; }

I have the same problem.

Chrome Version 71.0.3578.98

I got the same problem.

Same problem

Same problem

+1

+1

+1

any sollution ? i need to solve this problem for my current project

+1

+1

Hello, is there anyone who has found a solution to this issue?
I suspect it's got something to do with the vendor prefix since the domtoimage.toPng works perfectly on Firefox, but not on Chrome.
Would be highly appreciated if someone knows how to fix this issue. Thank you in advance!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

XiNiHa picture XiNiHa  路  4Comments

piyushSinghalDemo picture piyushSinghalDemo  路  8Comments

pete-hotchkiss picture pete-hotchkiss  路  6Comments

AbuSufyan picture AbuSufyan  路  7Comments

sumigoma picture sumigoma  路  4Comments