Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions dotcom-rendering/src/components/ArticleHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,10 @@ const darkBackground = css`
background-color: ${themePalette('--headline-background')};
`;

const immersiveDarkBackground = css`
background-color: ${themePalette('--headline-background-immersive')};
`;

const invertedText = css`
color: white;
background-color: black;
Expand Down Expand Up @@ -299,7 +303,7 @@ const gridHeadlineTextBelowDesktop = css`

${until.desktop} {
color: white;
background-color: ${themePalette('--headline-background')};
background-color: ${themePalette('--headline-background-immersive')};
white-space: pre-wrap;
padding-bottom: ${space[1]}px;
padding-left: 12px;
Expand All @@ -322,7 +326,7 @@ const immersiveHeadlineStyles = (
}

if (layoutType === 'immersiveLandscape') {
return [invertedText, darkBackground];
return [invertedText, immersiveDarkBackground];
}

return gridHeadlineTextBelowDesktop;
Expand Down Expand Up @@ -560,7 +564,10 @@ export const ArticleHeadline = ({
`,
]
: isInverted
? [invertedText, darkBackground]
? [
invertedText,
immersiveDarkBackground,
]
: gridHeadlineText,
]}
>
Expand Down
42 changes: 21 additions & 21 deletions dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export const StandardLayoutArticleGrid = ({
const isShowcase = format.display === ArticleDisplay.Showcase;
const isImmersive = format.display === ArticleDisplay.Immersive;
const isFeature = format.design === ArticleDesign.Feature;
const headlineBackground = themePalette('--headline-background');
const headlineBackground = themePalette('--headline-background-immersive');

const isFootballMatchReport =
format.design === ArticleDesign.MatchReport && !!footballMatchStatsUrl;
Expand Down Expand Up @@ -220,12 +220,22 @@ export const StandardLayoutArticleGrid = ({
`,
grid.container,
grid.outerRules(),
isImmersive &&
isLabs &&
isImmersive &&
css`
&::before,
&::after {
z-index: ${getZIndex('immersiveGridOuterRules')};
${from.desktop} {
&::before,
&::after {
z-index: ${getZIndex(
'immersiveGridOuterRules',
)};
}
}
/* Anchor the title consistently while wrapped text extends the media below it. */
grid-template-rows: ${immersiveMediaRowHeight} repeat(
6,
auto
);
`,
!isLabs &&
css`
Expand All @@ -247,16 +257,6 @@ export const StandardLayoutArticleGrid = ({
: '90px'} auto auto auto auto auto;
}
`,
isImmersive &&
css`
${until.desktop} {
/* Anchor the title consistently while wrapped text extends the media below it. */
grid-template-rows: ${immersiveMediaRowHeight} repeat(
6,
auto
);
}
`,
]}
>
<GridItem
Expand Down Expand Up @@ -358,6 +358,12 @@ export const StandardLayoutArticleGrid = ({
padding-bottom: ${space[8]}px;
}
`,
layoutType === 'immersiveLandscape' &&
css`
${from.desktop} {
padding-bottom: ${space[8]}px;
}
`,
layoutType === 'immersivePortrait' &&
css`
${from.desktop} {
Expand All @@ -367,12 +373,6 @@ export const StandardLayoutArticleGrid = ({
${themePalette('--article-border')};
}
`,
layoutType === 'immersiveLandscape' &&
css`
${from.desktop} {
padding-bottom: ${space[8]}px;
}
`,
]}
>
<ArticleHeadline
Expand Down
26 changes: 26 additions & 0 deletions dotcom-rendering/src/paletteDeclarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,28 @@ const headlineBackgroundDark: PaletteFunction = ({
}
};

// Merge this with the above functions once the new immersive grid layouts
// are fully rolled out and the old layout removed
const headlineBackgroundImmersiveLight: PaletteFunction = ({ theme }) => {
switch (theme) {
case Pillar.Lifestyle:
return '#310028';
case Pillar.Culture:
return '#251F15';
case Pillar.Sport:
return '#00243A';
case Pillar.Opinion:
return '#3E1302';
case Pillar.News:
return sourcePalette.neutral[10];
default:
return sourcePalette.neutral[7];
}
};

const headlineBackgroundImmersiveDark: PaletteFunction = () =>
sourcePalette.neutral[10];

const headlineBlogBackgroundLight: PaletteFunction = ({
design,
display,
Expand Down Expand Up @@ -7603,6 +7625,10 @@ const paletteColours = {
light: headlineBackgroundLight,
dark: headlineBackgroundDark,
},
'--headline-background-immersive': {
light: headlineBackgroundImmersiveLight,
dark: headlineBackgroundImmersiveDark,
},
'--headline-blog-background': {
light: headlineBlogBackgroundLight,
dark: headlineBlogBackgroundDark,
Expand Down
Loading