Skip to content

Commit 3eec8c1

Browse files
committed
fix header left padding and border
1 parent 78a6ede commit 3eec8c1

File tree

6 files changed

+83
-26
lines changed

6 files changed

+83
-26
lines changed

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css } from '@emotion/react';
22
import {
3+
between,
34
from,
45
headlineBold28,
56
headlineBold34,
@@ -116,13 +117,24 @@ const decideMobileHeadlineFont = (format: ArticleFormat) => {
116117
}
117118
};
118119

119-
const headlineFont = (format: ArticleFormat) => css`
120-
${decideMobileHeadlineFont(format)}
120+
const headlineFont = (format: ArticleFormat) => {
121+
if (format.design === ArticleDesign.Gallery) {
122+
return css`
123+
${decideMobileHeadlineFont(format)}
121124
122-
${from.tablet} {
123-
${decideHeadlineFont(format)}
125+
${from.desktop} {
126+
${decideHeadlineFont(format)}
127+
}
128+
`;
124129
}
125-
`;
130+
return css`
131+
${decideMobileHeadlineFont(format)}
132+
133+
${from.tablet} {
134+
${decideHeadlineFont(format)}
135+
}
136+
`;
137+
};
126138

127139
const invertedFontLineHeight = css`
128140
line-height: 2.1875rem;
@@ -371,6 +383,16 @@ const decideBottomPadding = ({
371383
}
372384
};
373385

386+
const galleryStyles = css`
387+
${grid.between('centre-column-start', 'grid-end')};
388+
grid-row: 7/9;
389+
390+
${until.tablet} {
391+
${grid.column.all}
392+
max-width: 620px;
393+
}
394+
`;
395+
374396
export const ArticleHeadline = ({
375397
headlineString,
376398
format,
@@ -825,15 +847,7 @@ export const ArticleHeadline = ({
825847
);
826848
case ArticleDesign.Gallery: {
827849
return (
828-
<div
829-
css={[
830-
darkBackground,
831-
grid.between('centre-column-start', 'grid-end'),
832-
css`
833-
grid-row: 7/9;
834-
`,
835-
]}
836-
>
850+
<div css={galleryStyles}>
837851
<WithAgeWarning
838852
tags={tags}
839853
webPublicationDateDeprecated={
@@ -850,9 +864,16 @@ export const ArticleHeadline = ({
850864
color: ${themePalette(
851865
'--headline-colour',
852866
)};
867+
${darkBackground};
868+
min-height: 84px;
853869
padding-bottom: ${space[6]}px;
854870
padding-left: ${space[3]}px;
855871
padding-right: ${space[3]}px;
872+
873+
${between.mobileLandscape.and
874+
.tablet} {
875+
padding-left: ${space[5]}px;
876+
}
856877
`,
857878
]}
858879
>

dotcom-rendering/src/components/ArticleMeta.web.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,13 @@ export const metaContainer = (format: ArticleFormat) => {
190190
case ArticleDesign.Gallery:
191191
return css`
192192
${grid.column.centre}
193-
margin-bottom: ${space[3]}px;
194-
margin-left: ${space[3]}px;
193+
padding-bottom: ${space[3]}px;
194+
padding-left: ${space[3]}px;
195195
margin-right: ${space[3]}px;
196+
${from.tablet} {
197+
border-left: 1px solid
198+
${themePalette('--article-border')};
199+
}
196200
`;
197201
default:
198202
return defaultMargins;

dotcom-rendering/src/components/ArticleTitle.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from '@emotion/react';
2-
import { from } from '@guardian/source/foundations';
2+
import { from, until } from '@guardian/source/foundations';
33
import { grid } from '../../src/grid';
44
import {
55
ArticleDesign,
@@ -47,6 +47,10 @@ const galleryStyles = css`
4747
grid-row: 6/7;
4848
max-width: 400px;
4949
min-width: 200px;
50+
51+
${until.tablet} {
52+
${grid.column.all}
53+
}
5054
`;
5155

5256
export const ArticleTitle = ({

dotcom-rendering/src/components/SeriesSectionLink.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css } from '@emotion/react';
22
import {
3+
between,
34
from,
45
headlineBold17,
56
headlineBold20,
@@ -169,6 +170,10 @@ const sectionPadding = (design: ArticleDesign) => {
169170
if (design === ArticleDesign.Gallery) {
170171
return css`
171172
padding: 0 ${space[2]}px 0 ${space[3]}px;
173+
174+
${between.mobileLandscape.and.tablet} {
175+
padding-left: ${space[5]}px;
176+
}
172177
`;
173178
}
174179
return css`

dotcom-rendering/src/components/Standfirst.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,16 +322,19 @@ const standfirstStyles = ({ display, design, theme }: ArticleFormat) => {
322322
color: ${palette('--standfirst-text')};
323323
background-color: ${palette('--standfirst-background')};
324324
325+
padding-left: ${space[0]}px;
326+
margin-right: ${space[3]}px;
327+
325328
${from.tablet} {
326329
${grid.span('centre-column-start', 7)}
330+
padding-left: 12px;
331+
border-left: 1px solid
332+
${palette('--article-border')};
327333
}
328334
329335
${from.desktop} {
330336
${grid.span('centre-column-start', 6)}
331337
}
332-
margin-bottom: ${space[3]}px;
333-
margin-left: ${space[3]}px;
334-
margin-right: ${space[3]}px;
335338
`;
336339
default:
337340
switch (theme) {

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { css } from '@emotion/react';
2-
import { from } from '@guardian/source/foundations';
2+
import {
3+
between,
4+
from,
5+
} from '@guardian/source/foundations';
36
import { ArticleHeadline } from '../components/ArticleHeadline';
47
import { ArticleMetaApps } from '../components/ArticleMeta.apps';
58
import { ArticleMeta } from '../components/ArticleMeta.web';
@@ -39,6 +42,10 @@ const border = css({
3942
const headerStyles = css`
4043
${grid.container}
4144
background-color: ${palette('--article-inner-background')};
45+
46+
${from.tablet} {
47+
border-bottom: 1px solid ${palette('--article-border')};
48+
}
4249
`;
4350

4451
export const GalleryLayout = (props: WebProps | AppProps) => {
@@ -158,16 +165,29 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
158165
${from.leftCol} {
159166
${grid.column.left}
160167
}
168+
${between.tablet.and.leftCol} {
169+
border-left: 1px solid
170+
${palette('--article-border')};
171+
}
172+
${from.leftCol} {
173+
position: relative; /* allows the ::after to be positioned relative to this */
174+
&::after {
175+
content: '';
176+
position: absolute;
177+
right: -21px;
178+
top: 0;
179+
bottom: 0;
180+
width: 1px;
181+
background-color: ${palette(
182+
'--article-border',
183+
)};
184+
}
185+
}
161186
`,
162187
]}
163188
>
164189
Main media caption
165190
</div>
166-
<div
167-
css={[grid.between('centre-column-start', 'grid-end')]}
168-
>
169-
Meta
170-
</div>
171191
</header>
172192
{gallery.images.map((element, idx) => (
173193
<GalleryImage

0 commit comments

Comments
 (0)