Skip to content

Commit 5873ef5

Browse files
authored
Merge pull request #13693 from guardian/doml/fix-sublink-hover-styles
Fix sublink hover styles
2 parents 0f4f1ee + 2e4532c commit 5873ef5

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ const sublinkHoverStyles = css`
5959
.card-headline .show-underline {
6060
text-decoration: none;
6161
}
62+
.image-overlay {
63+
background-color: transparent;
64+
}
6265
}
6366
`;
6467

dotcom-rendering/src/components/FeatureCard.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ const hoverStyles = css`
7878
}
7979
`;
8080

81+
/** When we hover on sublinks, we want to prevent the general hover styles applying */
82+
const sublinkHoverStyles = css`
83+
:has(ul.sublinks:hover) {
84+
.card-headline .show-underline {
85+
text-decoration: none;
86+
}
87+
.image-overlay {
88+
background-color: transparent;
89+
}
90+
}
91+
`;
92+
8193
const contentStyles = css`
8294
display: flex;
8395
flex-basis: 100%;
@@ -332,7 +344,7 @@ export const FeatureCard = ({
332344
return (
333345
<FormatBoundary format={format}>
334346
<ContainerOverrides containerPalette={containerPalette}>
335-
<div css={[baseCardStyles, hoverStyles]}>
347+
<div css={[baseCardStyles, hoverStyles, sublinkHoverStyles]}>
336348
{!showYoutubeVideo && (
337349
<CardLink
338350
linkTo={linkTo}

0 commit comments

Comments
 (0)