Skip to content

Commit b4f302f

Browse files
committed
ensures link stays on top of the card content to allow click through to the configured brand URL
1 parent 95a59c5 commit b4f302f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

dotcom-rendering/src/components/SponsoredContentLabel.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
visuallyHidden,
66
} from '@guardian/source/foundations';
77
import { decideBrandingLogo } from '../lib/decideLogo';
8+
import { getZIndex } from '../lib/getZIndex';
89
import { palette } from '../palette';
910
import type { Branding } from '../types/branding';
1011
import type { DCRContainerPalette } from '../types/front';
@@ -52,6 +53,11 @@ const verticalStyles = {
5253
`,
5354
};
5455

56+
const linkStyles = css`
57+
/* See: https://css-tricks.com/nested-links/ */
58+
z-index: ${getZIndex('card-nested-link')};
59+
`;
60+
5561
/**
5662
* Component used to display "paid for" label alonside the sponsor logo
5763
* for a particular set of branding
@@ -90,6 +96,7 @@ export const SponsoredContentLabel = ({
9096
: 'This content has been paid for by an advertiser and produced by the Guardian Labs team.'}
9197
</span>
9298
<a
99+
css={linkStyles}
93100
href={logo.link}
94101
data-sponsor={branding.sponsorName.toLowerCase()}
95102
rel="nofollow"

0 commit comments

Comments
 (0)