From 52c0675d7e6e645a81a0809cb7b49e14ab4287e5 Mon Sep 17 00:00:00 2001 From: Anna Beddow Date: Thu, 18 Jun 2026 11:09:44 +0100 Subject: [PATCH 1/2] Apply hover styles to loop cards in the test variant --- dotcom-rendering/src/components/Card/Card.tsx | 4 ++++ .../src/components/Card/components/CardWrapper.tsx | 12 +++++++++--- .../src/components/Card/components/MediaWrapper.tsx | 11 ++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dotcom-rendering/src/components/Card/Card.tsx b/dotcom-rendering/src/components/Card/Card.tsx index 3cc1a741fc3..c85c10761d2 100644 --- a/dotcom-rendering/src/components/Card/Card.tsx +++ b/dotcom-rendering/src/components/Card/Card.tsx @@ -821,6 +821,7 @@ export const Card = ({ ? palette('--onward-content-top-border') : undefined } + isLoopAndInLoopClickTestVariant={isLoopAndInLoopClickTestVariant} > {media.type === 'slideshow' && ( css` :hover .media-overlay { width: 100%; height: 100%; @@ -59,7 +60,11 @@ const hoverStyles = css` */ :has( ul.sublinks:hover, - .video-container:not(.cinemagraph):hover, + .video-container:not( + ${isLoopAndInLoopClickTestVariant + ? `.cinemagraph, .loop` + : `.cinemagraph`} + ):hover, .slideshow-carousel-footer:hover, .branding-logo:hover ) { @@ -100,6 +105,7 @@ export const CardWrapper = ({ showTopBarMobile, containerPalette, topBarColour = palette('--card-border-top'), + isLoopAndInLoopClickTestVariant, }: Props) => { return ( @@ -107,7 +113,7 @@ export const CardWrapper = ({
{ const isHorizontalOnMobile = mediaPositionOnMobile === 'left' || mediaPositionOnMobile === 'right'; @@ -209,6 +215,7 @@ export const MediaWrapper = ({ css` /* position relative is required here to bound the image overlay */ position: relative; + img { width: 100%; display: block; @@ -232,7 +239,9 @@ export const MediaWrapper = ({ <> {children} {/* This overlay is styled when the CardLink is hovered */} - {(mediaType === 'picture' || mediaType === 'cinemagraph') && ( + {(mediaType === 'picture' || + mediaType === 'cinemagraph' || + isLoopAndInLoopClickTestVariant == true) && (
Date: Thu, 18 Jun 2026 11:34:39 +0100 Subject: [PATCH 2/2] Apply hover styles to loop feature cards in the test variant --- .../src/components/FeatureCard.tsx | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/dotcom-rendering/src/components/FeatureCard.tsx b/dotcom-rendering/src/components/FeatureCard.tsx index aec4d72f1e2..f2c069c24fa 100644 --- a/dotcom-rendering/src/components/FeatureCard.tsx +++ b/dotcom-rendering/src/components/FeatureCard.tsx @@ -83,7 +83,7 @@ const underlineOnHoverStyles = css` } `; -const hoverStyles = css` +const hoverStyles = (isLoopAndInLoopClickTestVariant: boolean) => css` :hover .media-overlay { position: absolute; top: 0; @@ -91,6 +91,8 @@ const hoverStyles = css` width: 100%; height: 100%; background-color: ${palette('--card-background-hover')}; + + ${isLoopAndInLoopClickTestVariant && loopClickThroughOverlayStyles} } ${underlineOnHoverStyles} @@ -106,6 +108,12 @@ const hoverStyles = css` } `; +const loopClickThroughOverlayStyles = css` + z-index: ${getZIndex('mediaOverlay')}; + cursor: pointer; + pointer-events: none; +`; + const contentStyles = css` display: flex; flex-basis: 100%; @@ -507,9 +515,15 @@ export const FeatureCard = ({ const aspectRatioNumber = isImmersive ? 5 / 3 : 4 / 5; - /* The whole card is clickable on cinemagraphs and pictures */ + /** The whole card is clickable for: + * - cinemagraphs + * - pictures + * - loops in the loop click test variant group + * */ const allowLinkThroughOverlay = - media.style === 'cinemagraph' || media.type === 'picture'; + media.style === 'cinemagraph' || + media.type === 'picture' || + isLoopAndInLoopClickTestVariant; return ( @@ -517,7 +531,9 @@ export const FeatureCard = ({
{!isYoutubeVideo && !isSelfHostedVideoWithControls && ( @@ -692,7 +708,8 @@ export const FeatureCard = ({ )} {/* This overlay is styled when the CardLink is hovered */} - {!isSelfHostedVideoWithControls && ( + {(!isSelfHostedVideoWithControls || + isLoopAndInLoopClickTestVariant) && (
)}