Skip to content

Commit d8d92ab

Browse files
Delete legacy immersive layout and styling
1 parent 9370061 commit d8d92ab

5 files changed

Lines changed: 25 additions & 1206 deletions

File tree

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 12 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import {
2828
ArticleSpecial,
2929
Pillar,
3030
} from '../lib/articleFormat';
31-
import { getZIndex } from '../lib/getZIndex';
3231
import { palette as themePalette } from '../palette';
3332
import type { StarRating as Rating } from '../types/content';
3433
import type { TagType } from '../types/tag';
@@ -216,56 +215,6 @@ const invertedStyles = css`
216215
box-decoration-break: clone;
217216
`;
218217

219-
const legacyInvertedStyles = css`
220-
white-space: pre-wrap;
221-
padding-right: ${space[1]}px;
222-
padding-bottom: ${space[1]}px;
223-
box-shadow: -6px 0 0 ${themePalette('--headline-background')};
224-
/* Box decoration is required to push the box shadow out on Firefox */
225-
box-decoration-break: clone;
226-
`;
227-
228-
const legacyImmersiveStyles = css`
229-
min-height: 112px;
230-
padding-bottom: ${space[6]}px;
231-
padding-left: ${space[1]}px;
232-
233-
${from.mobileLandscape} {
234-
padding-left: ${space[3]}px;
235-
}
236-
237-
${from.tablet} {
238-
padding-left: ${space[1]}px;
239-
}
240-
241-
margin-right: ${space[5]}px;
242-
`;
243-
244-
const legacyImmersiveWrapper = css`
245-
margin-left: 6px;
246-
247-
${from.tablet} {
248-
margin-left: 16px;
249-
}
250-
251-
${from.leftCol} {
252-
margin-left: 25px;
253-
}
254-
255-
flex-grow: 1;
256-
z-index: ${getZIndex('articleHeadline')};
257-
258-
${until.mobileLandscape} {
259-
margin-right: 40px;
260-
}
261-
`;
262-
263-
const legacyInvertedText = css`
264-
white-space: pre-wrap;
265-
padding-bottom: ${space[1]}px;
266-
padding-right: ${space[1]}px;
267-
`;
268-
269218
const darkBackground = css`
270219
background-color: ${themePalette('--headline-background')};
271220
`;
@@ -307,20 +256,7 @@ const gridHeadlineTextBelowDesktop = css`
307256
}
308257
`;
309258

310-
const immersiveHeadlineStyles = (
311-
layoutType: LayoutType | undefined,
312-
isLegacyImmersive: boolean,
313-
) => {
314-
if (isLegacyImmersive) {
315-
return [
316-
legacyImmersiveWrapper,
317-
darkBackground,
318-
css`
319-
color: ${themePalette('--headline-colour')};
320-
`,
321-
];
322-
}
323-
259+
const immersiveHeadlineStyles = (layoutType: LayoutType | undefined) => {
324260
if (layoutType === 'immersiveLandscapeDefault') {
325261
return [invertedText, darkBackground];
326262
}
@@ -350,29 +286,13 @@ const zIndex = css`
350286
z-index: 1;
351287
`;
352288

353-
const ageWarningMargins = (
354-
format: ArticleFormat,
355-
isLegacyImmersive: boolean,
356-
) => {
357-
if (format.design === ArticleDesign.Gallery) {
289+
const ageWarningMargins = (format: ArticleFormat) => {
290+
if (
291+
format.design === ArticleDesign.Gallery ||
292+
format.display === ArticleDisplay.Immersive
293+
) {
358294
return '';
359295
}
360-
if (format.display === ArticleDisplay.Immersive) {
361-
return isLegacyImmersive
362-
? css`
363-
margin-left: 0;
364-
margin-bottom: 0;
365-
366-
${from.tablet} {
367-
margin-left: 10px;
368-
}
369-
370-
${from.leftCol} {
371-
margin-left: 20px;
372-
}
373-
`
374-
: '';
375-
}
376296
return css`
377297
margin-top: 12px;
378298
margin-left: -10px;
@@ -395,14 +315,12 @@ const WithAgeWarning = ({
395315
format,
396316
children,
397317
snapToInverted = false,
398-
isLegacyImmersive = false,
399318
}: {
400319
tags: TagType[];
401320
webPublicationDateDeprecated: string;
402321
format: ArticleFormat;
403322
children: React.ReactNode;
404323
snapToInverted?: boolean;
405-
isLegacyImmersive?: boolean;
406324
}) => {
407325
const age = getAgeWarning(tags, webPublicationDateDeprecated);
408326

@@ -411,14 +329,8 @@ const WithAgeWarning = ({
411329
<>
412330
<div
413331
css={[
414-
ageWarningMargins(format, isLegacyImmersive),
415-
isLegacyImmersive &&
416-
css`
417-
background-color: ${themePalette(
418-
'--age-warning-wrapper-background',
419-
)};
420-
`,
421-
snapToInverted && !isLegacyImmersive
332+
ageWarningMargins(format),
333+
snapToInverted
422334
? css`
423335
${from.desktop} {
424336
margin-left: -10px;
@@ -524,7 +436,6 @@ export const ArticleHeadline = ({
524436
starRating,
525437
}: Props) => {
526438
const isInverted = layoutType === 'immersiveLandscapeDefault';
527-
const isLegacyImmersive = layoutType == null;
528439
switch (format.display) {
529440
case ArticleDisplay.Immersive: {
530441
switch (format.design) {
@@ -550,18 +461,9 @@ export const ArticleHeadline = ({
550461
format.theme === ArticleSpecial.Labs
551462
? labsFont
552463
: headlineFont(format),
553-
isLegacyImmersive
554-
? [
555-
legacyInvertedText,
556-
css`
557-
color: ${themePalette(
558-
'--headline-colour',
559-
)};
560-
`,
561-
]
562-
: isInverted
563-
? [invertedText, darkBackground]
564-
: gridHeadlineText,
464+
isInverted
465+
? [invertedText, darkBackground]
466+
: gridHeadlineText,
565467
]}
566468
>
567469
{headlineString}
@@ -588,26 +490,14 @@ export const ArticleHeadline = ({
588490
}
589491
format={format}
590492
snapToInverted={isInverted}
591-
isLegacyImmersive={isLegacyImmersive}
592493
>
593-
<h1
594-
css={[
595-
immersiveHeadlineStyles(
596-
layoutType,
597-
isLegacyImmersive,
598-
),
599-
]}
600-
>
494+
<h1 css={[immersiveHeadlineStyles(layoutType)]}>
601495
<span
602496
css={[
603497
format.theme === ArticleSpecial.Labs
604498
? jumboLabsFont
605499
: headlineFont(format),
606500
maxWidth,
607-
isLegacyImmersive && [
608-
legacyInvertedStyles,
609-
legacyImmersiveStyles,
610-
],
611501
displayBlock,
612502
]}
613503
>

dotcom-rendering/src/components/ArticleTitle.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const sectionStyles = css`
2929
}
3030
`;
3131

32-
const immersiveGridMargins = css`
32+
const immersiveMargins = css`
3333
max-width: 500px;
3434
min-width: 200px;
3535
margin-bottom: 0;
@@ -39,18 +39,6 @@ const immersiveGridMargins = css`
3939
}
4040
`;
4141

42-
const legacyImmersiveMargins = css`
43-
max-width: 400px;
44-
min-width: 200px;
45-
margin-bottom: 4px;
46-
${from.tablet} {
47-
margin-left: 16px;
48-
}
49-
${from.leftCol} {
50-
margin-left: 25px;
51-
}
52-
`;
53-
5442
const galleryStyles = css`
5543
${grid.column.all}
5644
@@ -84,9 +72,7 @@ export const ArticleTitle = ({
8472
<div
8573
css={
8674
format.display === ArticleDisplay.Immersive
87-
? layoutType == null
88-
? legacyImmersiveMargins
89-
: immersiveGridMargins
75+
? immersiveMargins
9076
: undefined
9177
}
9278
>

dotcom-rendering/src/layouts/DecideLayout.tsx

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
ArticleDesign,
3-
ArticleDisplay,
4-
ArticleSpecial,
5-
} from '../lib/articleFormat';
1+
import { ArticleDesign, ArticleDisplay } from '../lib/articleFormat';
62
import type { NavType } from '../model/extract-nav';
73
import type { Article } from '../types/article';
84
import type { RenderingTarget } from '../types/renderingTarget';
@@ -13,7 +9,6 @@ import { GalleryLayout } from './GalleryLayout';
139
import { HostedArticleLayout } from './HostedArticleLayout';
1410
import { HostedGalleryLayout } from './HostedGalleryLayout';
1511
import { HostedVideoLayout } from './HostedVideoLayout';
16-
import { ImmersiveLayout } from './ImmersiveLayout';
1712
import { InteractiveLayout } from './InteractiveLayout';
1813
import { LiveLayout } from './LiveLayout';
1914
import { NewsletterSignupLayout } from './NewsletterSignupLayout';
@@ -58,21 +53,13 @@ const DecideLayoutApps = ({ article, renderingTarget }: AppProps) => {
5853
);
5954
}
6055
default: {
61-
return article.theme === ArticleSpecial.Labs &&
62-
article.design === ArticleDesign.Standard ? (
56+
return (
6357
<StandardLayout
6458
article={article.frontendData}
6559
format={format}
6660
renderingTarget={renderingTarget}
6761
serverTime={serverTime}
6862
/>
69-
) : (
70-
<ImmersiveLayout
71-
article={article.frontendData}
72-
format={format}
73-
renderingTarget={renderingTarget}
74-
serverTime={serverTime}
75-
/>
7663
);
7764
}
7865
}
@@ -242,23 +229,14 @@ const DecideLayoutWeb = ({ article, NAV, renderingTarget }: WebProps) => {
242229
);
243230
}
244231
default: {
245-
return article.theme === ArticleSpecial.Labs &&
246-
article.design === ArticleDesign.Standard ? (
232+
return (
247233
<StandardLayout
248234
article={article.frontendData}
249235
format={format}
250236
NAV={NAV}
251237
renderingTarget={renderingTarget}
252238
serverTime={serverTime}
253239
/>
254-
) : (
255-
<ImmersiveLayout
256-
article={article.frontendData}
257-
format={format}
258-
NAV={NAV}
259-
renderingTarget={renderingTarget}
260-
serverTime={serverTime}
261-
/>
262240
);
263241
}
264242
}

0 commit comments

Comments
 (0)