Skip to content

Commit 35635e3

Browse files
committed
Fix visual bug in highlights on Safari 14
1 parent ad3b3c9 commit 35635e3

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

dotcom-rendering/src/components/Card/components/CardWrapper.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ const baseCardStyles = css`
2020
flex-direction: column;
2121
justify-content: space-between;
2222
width: 100%;
23-
/* We absolutely position the faux link
24-
so this is required here */
23+
/* We absolutely position the faux link so this is required here */
2524
position: relative;
2625
2726
/* Target Safari 10.1 */

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5887,8 +5887,16 @@ const highlightContainerMidFadeLight: PaletteFunction = () =>
58875887
const highlightContainerMidFadeDark: PaletteFunction = () =>
58885888
transparentColour(sourcePalette.neutral[10], 0.6);
58895889

5890-
const highlightContainerEndFadeLight: PaletteFunction = () => 'transparent';
5891-
const highlightContainerEndFadeDark: PaletteFunction = () => 'transparent';
5890+
/**
5891+
* Why not 'transparent'?
5892+
*
5893+
* Older versions of Safari (v14 and lower) misinterpret "transparent"
5894+
* when used in gradients: https://css-tricks.com/thing-know-gradients-transparent-black/
5895+
*/
5896+
const highlightContainerEndFadeLight: PaletteFunction = () =>
5897+
transparentColour(sourcePalette.neutral[100], 0);
5898+
const highlightContainerEndFadeDark: PaletteFunction = () =>
5899+
transparentColour(sourcePalette.neutral[10], 0);
58925900

58935901
const pinnedPostBorderLight: PaletteFunction = ({ theme }) => {
58945902
switch (theme) {

0 commit comments

Comments
 (0)