@@ -28,7 +28,6 @@ import {
2828 ArticleSpecial ,
2929 Pillar ,
3030} from '../lib/articleFormat' ;
31- import { getZIndex } from '../lib/getZIndex' ;
3231import { palette as themePalette } from '../palette' ;
3332import type { StarRating as Rating } from '../types/content' ;
3433import type { TagType } from '../types/tag' ;
@@ -216,56 +215,6 @@ const invertedStyles = css`
216215 box- decor ation- break: clone;
217216` ;
218217
219- const legacyInvertedStyles = css `
220- white-space: pre-wrap;
221- padding- right: ${ space [ 1 ] } px;
222- padding- botto m: ${ 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- decor ation- break: clone;
226- ` ;
227-
228- const legacyImmersiveStyles = css `
229- min- height: 112px;
230- padding- botto m: ${ 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- botto m: ${ space [ 1 ] } px;
266- padding- right: ${ space [ 1 ] } px;
267- ` ;
268-
269218const 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- botto m: 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- to p: 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 >
0 commit comments