diff --git a/.changeset/chilly-elephants-retire.md b/.changeset/chilly-elephants-retire.md new file mode 100644 index 000000000..7f4dd4784 --- /dev/null +++ b/.changeset/chilly-elephants-retire.md @@ -0,0 +1,5 @@ +--- +"@codeimage/dom-export": patch +--- + +fix: disable box-shadow rendering on ios/safari diff --git a/packages/dom-export/src/lib/cloneNode.ts b/packages/dom-export/src/lib/cloneNode.ts index 0fd5d8b15..df14025ff 100644 --- a/packages/dom-export/src/lib/cloneNode.ts +++ b/packages/dom-export/src/lib/cloneNode.ts @@ -1,4 +1,4 @@ -import {isIOS} from '@solid-primitives/platform'; +import {isIOS, isSafari} from '@solid-primitives/platform'; import {clonePseudoElements} from './clonePseudoElements'; import {copyFont, copyUserComputedStyleFast} from './cloneStyle'; import {getBlobFromURL} from './getBlobFromURL'; @@ -119,7 +119,7 @@ function cloneCSSStyle( } const boxShadow = sourceStyle.getPropertyValue('boxShadow'); - if (boxShadow !== 'none' && isIOS) { + if (boxShadow !== 'none' && (isIOS || isSafari)) { clonedNode.setAttribute( 'style', `${clonedNode.getAttribute('style')};box-shadow:none!important;`, diff --git a/packages/dom-export/src/lib/clonePseudoElements.ts b/packages/dom-export/src/lib/clonePseudoElements.ts index c7f9d9d22..30cb586e7 100644 --- a/packages/dom-export/src/lib/clonePseudoElements.ts +++ b/packages/dom-export/src/lib/clonePseudoElements.ts @@ -1,3 +1,4 @@ +import {isIOS, isSafari} from '@solid-primitives/platform'; import {toArray, uuid} from './util'; type Pseudo = ':before' | ':after'; @@ -24,6 +25,9 @@ function getPseudoElementStyle( style: CSSStyleDeclaration, ): Text { const selector = `.${className}:${pseudo}`; + if (isIOS || isSafari) { + style.boxShadow = 'unset'; + } const cssText = style.cssText ? formatCSSText(style) : formatCSSProperties(style);