Skip to content

Commit c4068b7

Browse files
deedeehmarjisound
andcommitted
Add Labs header and fix fontStyles for Gallery Labs
Co-authored-by: Marjan Kalanaki <[email protected]>
1 parent 21b5fd0 commit c4068b7

File tree

2 files changed

+63
-35
lines changed

2 files changed

+63
-35
lines changed

dotcom-rendering/src/components/SeriesSectionLink.tsx

Lines changed: 46 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
space,
99
textSans17,
1010
textSans20,
11+
textSansBold17,
1112
textSansBold20,
1213
until,
1314
} from '@guardian/source/foundations';
@@ -101,43 +102,60 @@ const invertedStyle = (design: ArticleDesign) => {
101102
};
102103

103104
const fontStyles = (format: ArticleFormat) => {
104-
if (format.design === ArticleDesign.Gallery) {
105-
return css`
106-
${headlineBold17}
107-
${from.desktop} {
108-
${headlineBold20}
109-
line-height: 36px;
110-
}
111-
line-height: 36px;
112-
`;
113-
}
114-
switch (format.theme) {
115-
case ArticleSpecial.Labs:
116-
switch (format.display) {
117-
case ArticleDisplay.Immersive:
105+
switch (format.design) {
106+
case ArticleDesign.Gallery:
107+
switch (format.theme) {
108+
case ArticleSpecial.Labs:
118109
return css`
119-
${textSansBold20};
120-
line-height: 23px;
121-
${from.leftCol} {
122-
line-height: 20px;
110+
${textSansBold17};
111+
line-height: 36px;
112+
${from.desktop} {
113+
${textSansBold20};
114+
// This is added again because there is a line-height in textSansBold20 so we are overriding it
115+
line-height: 36px;
123116
}
124117
`;
125118
default:
126119
return css`
127-
${textSans20};
128-
line-height: 23px;
129-
${from.leftCol} {
130-
line-height: 20px;
120+
${headlineBold17}
121+
line-height: 36px;
122+
123+
${from.desktop} {
124+
${headlineBold20}
125+
// This is added again because there is a line-height in textSansBold20 so we are overriding it
126+
line-height: 36px;
131127
}
132128
`;
133129
}
134130
default:
135-
return css`
136-
${headlineBold17}
137-
${from.wide} {
138-
${headlineBold20}
139-
}
140-
`;
131+
switch (format.theme) {
132+
case ArticleSpecial.Labs:
133+
switch (format.display) {
134+
case ArticleDisplay.Immersive:
135+
return css`
136+
${textSansBold20};
137+
line-height: 23px;
138+
${from.leftCol} {
139+
line-height: 20px;
140+
}
141+
`;
142+
default:
143+
return css`
144+
${textSans20};
145+
line-height: 23px;
146+
${from.leftCol} {
147+
line-height: 20px;
148+
}
149+
`;
150+
}
151+
default:
152+
return css`
153+
${headlineBold17}
154+
${from.wide} {
155+
${headlineBold20}
156+
}
157+
`;
158+
}
141159
}
142160
};
143161

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { DesktopAdSlot, MobileAdSlot } from '../components/GalleryAdSlots';
1919
import { GalleryImage } from '../components/GalleryImage';
2020
import { HeaderAdSlot } from '../components/HeaderAdSlot';
2121
import { Island } from '../components/Island';
22+
import { LabsHeader } from '../components/LabsHeader';
2223
import { MainMediaGallery } from '../components/MainMediaGallery';
2324
import { Masthead } from '../components/Masthead/Masthead';
2425
import { Section } from '../components/Section';
@@ -51,12 +52,6 @@ interface AppProps extends Props {
5152
renderingTarget: 'Apps';
5253
}
5354

54-
const border = css({
55-
borderWidth: 1,
56-
borderStyle: 'solid',
57-
color: '#ccc',
58-
});
59-
6055
const headerStyles = css`
6156
${grid.container}
6257
background-color: ${themePalette('--article-inner-background')};
@@ -200,12 +195,27 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
200195
/>
201196
</div>
202197
)}
198+
199+
{format.theme === ArticleSpecial.Labs && (
200+
<Stuck>
201+
<Section
202+
fullWidth={true}
203+
showTopBorder={false}
204+
backgroundColour={sourcePalette.labs[400]}
205+
borderColour={sourcePalette.neutral[60]}
206+
sectionId="labs-header"
207+
element="aside"
208+
>
209+
<LabsHeader editionId={frontendData.editionId} />
210+
</Section>
211+
</Stuck>
212+
)}
213+
203214
<main
204215
css={{
205216
backgroundColor: themePalette('--article-background'),
206217
}}
207218
>
208-
<div css={border}>Labs header</div>
209219
<header css={headerStyles}>
210220
<MainMediaGallery
211221
mainMedia={gallery.mainMedia}

0 commit comments

Comments
 (0)