Skip to content

Commit de518d3

Browse files
marjisoundJamieB-gu
andcommitted
Fix gallery paddings and borders
This is to align them with the grid column in the grid layout Co-authored-by: Jamie B <[email protected]>
1 parent 3eec8c1 commit de518d3

File tree

5 files changed

+40
-29
lines changed

5 files changed

+40
-29
lines changed

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,13 @@ const decideBottomPadding = ({
384384
};
385385

386386
const galleryStyles = css`
387-
${grid.between('centre-column-start', 'grid-end')};
387+
${grid.between('grid-start', 'centre-column-end')}
388+
388389
grid-row: 7/9;
389390
390-
${until.tablet} {
391-
${grid.column.all}
392-
max-width: 620px;
391+
${from.tablet} {
392+
${grid.between('centre-column-start', 'grid-end')};
393+
margin-left: -10px;
393394
}
394395
`;
395396

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

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,11 +191,19 @@ export const metaContainer = (format: ArticleFormat) => {
191191
return css`
192192
${grid.column.centre}
193193
padding-bottom: ${space[3]}px;
194-
padding-left: ${space[3]}px;
195-
margin-right: ${space[3]}px;
196194
${from.tablet} {
197-
border-left: 1px solid
198-
${themePalette('--article-border')};
195+
position: relative;
196+
&::before {
197+
content: '';
198+
position: absolute;
199+
left: -10px;
200+
top: 0;
201+
bottom: 0;
202+
width: 1px;
203+
background-color: ${themePalette(
204+
'--article-border',
205+
)};
206+
}
199207
}
200208
`;
201209
default:

dotcom-rendering/src/components/ArticleTitle.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from '@emotion/react';
2-
import { from, until } from '@guardian/source/foundations';
2+
import { from } from '@guardian/source/foundations';
33
import { grid } from '../../src/grid';
44
import {
55
ArticleDesign,
@@ -43,13 +43,15 @@ const immersiveMargins = css`
4343
`;
4444

4545
const galleryStyles = css`
46-
${grid.between('centre-column-start', 'grid-end')};
46+
${grid.column.all}
47+
4748
grid-row: 6/7;
4849
max-width: 400px;
4950
min-width: 200px;
5051
51-
${until.tablet} {
52-
${grid.column.all}
52+
${from.tablet} {
53+
${grid.between('centre-column-start', 'grid-end')};
54+
margin-left: -10px;
5355
}
5456
`;
5557

dotcom-rendering/src/components/Standfirst.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -322,14 +322,21 @@ 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-
328325
${from.tablet} {
329326
${grid.span('centre-column-start', 7)}
330-
padding-left: 12px;
331-
border-left: 1px solid
332-
${palette('--article-border')};
327+
328+
position: relative;
329+
&::before {
330+
content: '';
331+
position: absolute;
332+
left: -10px;
333+
top: 0;
334+
bottom: 0;
335+
width: 1px;
336+
background-color: ${palette(
337+
'--article-border',
338+
)};
339+
}
333340
}
334341
335342
${from.desktop} {

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { css } from '@emotion/react';
2-
import {
3-
between,
4-
from,
5-
} from '@guardian/source/foundations';
2+
import { between, from } from '@guardian/source/foundations';
63
import { ArticleHeadline } from '../components/ArticleHeadline';
74
import { ArticleMetaApps } from '../components/ArticleMeta.apps';
85
import { ArticleMeta } from '../components/ArticleMeta.web';
@@ -165,16 +162,12 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
165162
${from.leftCol} {
166163
${grid.column.left}
167164
}
165+
position: relative;
168166
${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 {
167+
&::before {
175168
content: '';
176169
position: absolute;
177-
right: -21px;
170+
left: -10px;
178171
top: 0;
179172
bottom: 0;
180173
width: 1px;

0 commit comments

Comments
 (0)