Skip to content

Commit 02a0ba8

Browse files
authored
Merge pull request #16324 from guardian/sa-gallery-section-linlk
Remove some gallery-specific styling from section link
2 parents 21a9353 + 386d79a commit 02a0ba8

1 file changed

Lines changed: 21 additions & 39 deletions

File tree

dotcom-rendering/src/components/SeriesSectionLink.tsx

Lines changed: 21 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { css } from '@emotion/react';
22
import {
3-
between,
43
from,
54
headlineBold17,
65
headlineBold20,
@@ -83,23 +82,18 @@ const marginRight = css`
8382
}
8483
`;
8584

86-
const invertedStyle = (design: ArticleDesign) => {
87-
if (design === ArticleDesign.Gallery) {
88-
return '';
89-
}
90-
return css`
91-
/* Handle text wrapping onto a new line */
92-
white-space: pre-wrap;
93-
box-decoration-break: clone;
85+
const invertedStyle = css`
86+
/* Handle text wrapping onto a new line */
87+
white-space: pre-wrap;
88+
box-decoration-break: clone;
89+
line-height: 28px;
90+
padding-right: ${space[1]}px;
91+
padding-top: ${space[1]}px;
92+
padding-bottom: ${space[2]}px;
93+
${from.wide} {
9494
line-height: 28px;
95-
${from.leftCol} {
96-
line-height: 28px;
97-
}
98-
padding-right: ${space[1]}px;
99-
padding-top: ${space[1]}px;
100-
padding-bottom: ${space[3]}px;
101-
`;
102-
};
95+
}
96+
`;
10397

10498
const fontStyles = (format: ArticleFormat) => {
10599
switch (format.design) {
@@ -184,26 +178,15 @@ const breakWord = css`
184178
word-break: break-word;
185179
`;
186180

187-
const sectionPadding = (design: ArticleDesign) => {
188-
if (design === ArticleDesign.Gallery) {
189-
return css`
190-
padding: 0 ${space[2]}px 0 ${space[3]}px;
191-
192-
${between.mobileLandscape.and.tablet} {
193-
padding-left: ${space[5]}px;
194-
}
195-
`;
181+
const sectionPadding = css`
182+
padding-left: 10px;
183+
${from.mobileLandscape} {
184+
padding-left: 18px;
196185
}
197-
return css`
198-
padding-left: 10px;
199-
${from.mobileLandscape} {
200-
padding-left: 18px;
201-
}
202-
${from.tablet} {
203-
padding-left: ${space[1]}px;
204-
}
205-
`;
206-
};
186+
${from.tablet} {
187+
padding-left: ${space[1]}px;
188+
}
189+
`;
207190

208191
export const SeriesSectionLink = ({
209192
format,
@@ -358,9 +341,9 @@ export const SeriesSectionLink = ({
358341
css={[
359342
sectionLabelLink,
360343
fontStyles(format),
361-
invertedStyle(format.design),
344+
invertedStyle,
362345
breakWord,
363-
sectionPadding(format.design),
346+
sectionPadding,
364347
css`
365348
color: ${titleColour};
366349
background-color: ${themePalette(
@@ -369,7 +352,6 @@ export const SeriesSectionLink = ({
369352
`,
370353
format.design === ArticleDesign.Gallery &&
371354
css`
372-
display: inline-block;
373355
position: relative;
374356
`,
375357
format.display === ArticleDisplay.Immersive &&

0 commit comments

Comments
 (0)