Skip to content

Commit a1db210

Browse files
committed
Make play icon call responsible for positioning
1 parent 6abd398 commit a1db210

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,8 @@ const wideIconStyles = (
4343
}
4444
`;
4545

46-
const narrowPlayIconWidth = 56;
46+
export const narrowPlayIconWidth = 56;
4747
const narrowStyles = css`
48-
position: absolute;
49-
/**
50-
* Subject to change. We will wait to see how fronts editors use the
51-
* headlines and standfirsts before we decide on a final position.
52-
*/
53-
top: 35%;
54-
left: calc(50% - ${narrowPlayIconWidth / 2}px);
5548
width: ${narrowPlayIconWidth}px;
5649
height: ${narrowPlayIconWidth}px;
5750
display: flex;

dotcom-rendering/src/components/YoutubeAtom/YoutubeAtomFeatureCardOverlay.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { secondsToDuration } from '../../lib/formatTime';
66
import { palette } from '../../palette';
77
import type { AspectRatio } from '../../types/front';
88
import { CardFooter } from '../Card/components/CardFooter';
9-
import { PlayIcon } from '../Card/components/PlayIcon';
9+
import { narrowPlayIconWidth, PlayIcon } from '../Card/components/PlayIcon';
1010
import { TrailText } from '../Card/components/TrailText';
1111
import type { ResponsiveFontSize } from '../CardHeadline';
1212
import { CardHeadline } from '../CardHeadline';
@@ -87,6 +87,16 @@ const immersiveOverlayStyles = css`
8787
}
8888
`;
8989

90+
const playIconStyles = css`
91+
position: absolute;
92+
/**
93+
* Subject to change. We will wait to see how fronts editors use the
94+
* headlines and standfirsts before we decide on a final position.
95+
*/
96+
top: 35%;
97+
left: calc(50% - ${narrowPlayIconWidth / 2}px);
98+
`;
99+
90100
const videoPillStyles = css`
91101
position: absolute;
92102
top: ${space[2]}px;
@@ -183,7 +193,9 @@ export const YoutubeAtomFeatureCardOverlay = ({
183193
</div>
184194
) : null}
185195
<div className="image-overlay" />
186-
<PlayIcon iconWidth="narrow" />
196+
<div css={playIconStyles}>
197+
<PlayIcon iconWidth="narrow" />
198+
</div>
187199
<div
188200
css={[
189201
textOverlayStyles,

0 commit comments

Comments
 (0)