Skip to content

Commit 5bdfda7

Browse files
authored
fix(mask): add support for -webkit-mask and -webkit-mask-image (#382)
Add support for `mask` and `mask-image` properties for browsers that support them via webkit. # 334
1 parent aa3c979 commit 5bdfda7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/embed-images.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ async function embedBackground<T extends HTMLElement>(
2626
clonedNode: T,
2727
options: Options,
2828
) {
29-
if (!(await embedProp('background', clonedNode, options))) {
30-
await embedProp('background-image', clonedNode, options)
31-
}
32-
if (!(await embedProp('mask', clonedNode, options))) {
33-
await embedProp('mask-image', clonedNode, options)
34-
}
29+
;(await embedProp('background', clonedNode, options)) ||
30+
(await embedProp('background-image', clonedNode, options))
31+
;(await embedProp('mask', clonedNode, options)) ||
32+
(await embedProp('-webkit-mask', clonedNode, options)) ||
33+
(await embedProp('mask-image', clonedNode, options)) ||
34+
(await embedProp('-webkit-mask-image', clonedNode, options))
3535
}
3636

3737
async function embedImageNode<T extends HTMLElement | SVGImageElement>(

0 commit comments

Comments
 (0)