Skip to content

Commit

Permalink
fix(mask): add support for -webkit-mask and -webkit-mask-image (#382)
Browse files Browse the repository at this point in the history
Add support for `mask` and `mask-image` properties for browsers that support them via webkit.

# 334
  • Loading branch information
amiratak88 authored Feb 13, 2025
1 parent aa3c979 commit 5bdfda7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/embed-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ async function embedBackground<T extends HTMLElement>(
clonedNode: T,
options: Options,
) {
if (!(await embedProp('background', clonedNode, options))) {
await embedProp('background-image', clonedNode, options)
}
if (!(await embedProp('mask', clonedNode, options))) {
await embedProp('mask-image', clonedNode, options)
}
;(await embedProp('background', clonedNode, options)) ||
(await embedProp('background-image', clonedNode, options))
;(await embedProp('mask', clonedNode, options)) ||
(await embedProp('-webkit-mask', clonedNode, options)) ||
(await embedProp('mask-image', clonedNode, options)) ||
(await embedProp('-webkit-mask-image', clonedNode, options))
}

async function embedImageNode<T extends HTMLElement | SVGImageElement>(
Expand Down

0 comments on commit 5bdfda7

Please sign in to comment.