Skip to content

Commit 4a28246

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

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';
@@ -49,12 +50,6 @@ interface AppProps extends Props {
4950
renderingTarget: 'Apps';
5051
}
5152

52-
const border = css({
53-
borderWidth: 1,
54-
borderStyle: 'solid',
55-
color: '#ccc',
56-
});
57-
5853
const headerStyles = css`
5954
${grid.container}
6055
background-color: ${themePalette('--article-inner-background')};
@@ -177,12 +172,27 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
177172
/>
178173
</div>
179174
)}
175+
176+
{format.theme === ArticleSpecial.Labs && (
177+
<Stuck>
178+
<Section
179+
fullWidth={true}
180+
showTopBorder={false}
181+
backgroundColour={sourcePalette.labs[400]}
182+
borderColour={sourcePalette.neutral[60]}
183+
sectionId="labs-header"
184+
element="aside"
185+
>
186+
<LabsHeader editionId={frontendData.editionId} />
187+
</Section>
188+
</Stuck>
189+
)}
190+
180191
<main
181192
css={{
182193
backgroundColor: themePalette('--article-background'),
183194
}}
184195
>
185-
<div css={border}>Labs header</div>
186196
<header css={headerStyles}>
187197
<MainMediaGallery
188198
mainMedia={gallery.mainMedia}

0 commit comments

Comments
 (0)