Skip to content

Commit 2e4532c

Browse files
committed
feature card: don't highlight card when sublink hovered
1 parent c2d2f06 commit 2e4532c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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)