Skip to content
Draft
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
19 changes: 14 additions & 5 deletions dotcom-rendering/src/components/ArticleHeadline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -271,21 +271,27 @@ const darkBackground = css`
`;

const immersiveDarkBackground = css`
background-color: ${themePalette('--headline-background-immersive')};
${from.desktop} {
${from.tablet} {
background-color: ${themePalette('--headline-background-immersive')};
}
${from.tablet} {
padding-bottom: ${space[6]}px;
}
`;

const invertedText = css`
color: white;
background-color: black;
white-space: pre-wrap;
padding-bottom: ${space[1]}px;
padding-left: 12px;
padding-right: 18px;

${from.desktop} {
${from.tablet} {
margin-left: -20px;
padding-left: 20px;
}

${from.leftCol} {
margin-left: -10px;
padding-left: 10px;
padding-right: ${space[1]}px;
Expand Down Expand Up @@ -427,7 +433,10 @@ const WithAgeWarning = ({
`,
snapToInverted && !isLegacyImmersive
? css`
${from.desktop} {
${from.tablet} {
margin-left: -20px;
}
${from.leftCol} {
margin-left: -10px;
}
`
Expand Down
2 changes: 1 addition & 1 deletion dotcom-rendering/src/components/Figure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const mainMediaFigureStyles = (
height: 100%;
${isImmersiveLandscape &&
css`
${from.desktop} {
${from.tablet} {
height: calc(100vh - ${navAndLabsHeaderHeight});
min-height: calc(31.25rem - ${navAndLabsHeaderHeight});
}
Expand Down
23 changes: 23 additions & 0 deletions dotcom-rendering/src/components/SeriesSectionLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,27 @@ const immersiveGridTitleBelowDesktop = css`
}
`;

const immersiveLandscapeTitle = css`
${from.tablet} {
margin-left: -29px;
}
${from.desktop} {
margin-left: -10px;
}
${from.leftCol} {
margin-left: 0;
}

span {
${from.tablet} {
padding-left: 10px;
}
${from.leftCol} {
padding-left: 0;
}
}
`;

const immersiveGridTitleWrapperBelowDesktop = css`
${until.desktop} {
padding-left: 9px;
Expand Down Expand Up @@ -381,6 +402,8 @@ export const SeriesSectionLink = ({
format.display === ArticleDisplay.Immersive &&
layoutType !== undefined &&
immersiveGridTitleBelowDesktop,
layoutType === 'immersiveLandscape' &&
immersiveLandscapeTitle,
format.design === ArticleDesign.Gallery &&
css`
position: relative;
Expand Down
59 changes: 20 additions & 39 deletions dotcom-rendering/src/layouts/StandardLayoutArticleGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,45 +60,37 @@ const stretchLines = css`
}
`;

const immersiveMediaBelowDesktop = (
headlineBackground: string,
isMainMediaImage: boolean,
hasMinimumImageHeight: boolean,
) => css`
const immersiveMediaBelowDesktop = css`
${until.tablet} {
aspect-ratio: 4 / 5;
}
${until.desktop} {
position: relative;
aspect-ratio: 4 / 5;
overflow: hidden;

> div {
height: 100%;
}

${!isMainMediaImage && 'overflow: hidden;'}

&::after {
content: '';
position: absolute;
left: 0;
right: 0;
bottom: ${hasMinimumImageHeight ? '-1px' : '0'};
height: ${hasMinimumImageHeight
? '180px'
: isMainMediaImage
? 'min(20%, calc(200% - 120vw + 30px))'
: 'min(60%, 144px)'};
bottom: 0;
height: 250px;
z-index: ${getZIndex('mediaOverlay')};
background: linear-gradient(
to bottom,
rgba(0, 0, 0, ${hasMinimumImageHeight ? '0' : '0.08'}),
${headlineBackground} ${hasMinimumImageHeight ? '100%' : '72%'}
);
background: linear-gradient(180deg, #1a1a1a00, #1a1a1a 120px 100%);
backdrop-filter: blur(12px);
mask-image: linear-gradient(
to bottom,
transparent ${hasMinimumImageHeight ? '0%' : '40%'},
black 60%
180deg,
#1a1a1a00,
#1a1a1a0a,
#1a1a1a25,
#1a1a1a4f,
#1a1a1a80,
#1a1a1ab0,
#1a1a1ada,
#1a1a1af5 56px,
#1a1a1a 70px
);
pointer-events: none;
}
Expand Down Expand Up @@ -323,7 +315,7 @@ export const StandardLayoutArticleGrid = ({
css={[
isImmersive
? css`
${from.desktop} {
${from.tablet} {
align-self: start;
${mainMediaAspectRatio != null &&
`aspect-ratio: ${mainMediaAspectRatio.replace(':', ' / ')};`}
Expand All @@ -337,15 +329,11 @@ export const StandardLayoutArticleGrid = ({
aspect-ratio: 4/5;
`}

${immersiveMediaBelowDesktop(
headlineBackgroundImmersive,
isMainMediaImage,
hasMinimumImageHeight,
)}
${immersiveMediaBelowDesktop}

${hasMinimumImageHeight &&
css`
${until.desktop} {
${until.tablet} {
position: relative;
width: 100%;
min-width: 0;
Expand Down Expand Up @@ -405,10 +393,6 @@ export const StandardLayoutArticleGrid = ({
isImmersive &&
css`
z-index: ${getZIndex('articleHeadline')};

${until.desktop} {
padding-bottom: ${space[2]}px;
}
`,
layoutType === 'immersivePortrait' &&
css`
Expand Down Expand Up @@ -446,9 +430,6 @@ export const StandardLayoutArticleGrid = ({
z-index: ${getZIndex('articleHeadline')};

${until.desktop} {
margin-top: -3px;
background-color: ${headlineBackgroundImmersive};
padding-top: 1px;
padding-bottom: ${space[8]}px;
}
`,
Expand Down Expand Up @@ -524,7 +505,7 @@ export const StandardLayoutArticleGrid = ({
css={[
isImmersive &&
css`
${until.desktop} {
${until.tablet} {
padding-top: ${space[2]}px;
}
`,
Expand Down
24 changes: 14 additions & 10 deletions dotcom-rendering/src/layouts/lib/articleArrangements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,34 +321,38 @@ const immersivePortraitCss: LayoutCssMap = {

const immersiveLandscapeCss: LayoutCssMap = {
title: {
belowDesktop: `${grid.column.all} grid-row: 2; align-self: end;`,
mobile: `${grid.column.all} grid-row: 2; align-self: end;`,
tablet: `grid-row: 2; ${grid.between('centre-column-start', 'centre-column-end')};`,
desktop: 'grid-row: 2;',
},
headline: {
belowDesktop: `${grid.column.all} grid-row: 3;`,
mobile: `${grid.column.all} grid-row: 3;`,
tablet: `grid-row: 3 / span 2; ${grid.between('centre-column-start', 'centre-column-end')};`,
desktop: 'grid-row: 3 / span 2;',
wide: `${grid.between('centre-column-start', 14)};`,
},
media: {
belowDesktop: `${grid.column.all} grid-row: 1 / span 2;`,
mobile: `${grid.column.all} grid-row: 1 / span 3;`,
tablet: `grid-row: 1 / span 3; ${grid.between('centre-column-start', 'centre-column-end')};`,
desktop: `grid-row: 1 / span 3; ${grid.between('centre-column-start', 'right-column-end')};`,
leftCol: `grid-row: 1 / span 3; ${grid.between('left-column-start', 'right-column-end')};`,
},
standfirst: {
belowDesktop: 'grid-row: 4;',
desktop: 'grid-row: 5;',
mobile: 'grid-row: 4;',
tablet: 'grid-row: 5;',
},
caption: {
belowDesktop: 'grid-row: 5;',
desktop: 'grid-row: 6;',
mobile: 'grid-row: 5;',
tablet: 'grid-row: 6;',
},
meta: {
belowDesktop: 'grid-row: 6;',
desktop: `grid-row: 7;`,
mobile: 'grid-row: 6;',
tablet: `grid-row: 7;`,
leftCol: `grid-row: 5 / span 2; ${grid.column.left};`,
},
body: {
belowDesktop: 'grid-row: 7;',
mobile: 'grid-row: 7;',
tablet: 'grid-row: 8;',
leftCol: 'grid-row: 6;',
},
'right-column': {
Expand Down
Loading