Skip to content

Commit bdde5fb

Browse files
committed
Address PR comments
- Use grid paddedContainer instead of container which removes the need to add after & before pseudo elements - Add JSDoc comments to explain Picture imageMaxWidth - Remove un-necessary todo comment
1 parent aefc544 commit bdde5fb

File tree

3 files changed

+8
-30
lines changed

3 files changed

+8
-30
lines changed

dotcom-rendering/src/components/GalleryCaption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const GalleryCaption = ({
9494
format={format}
9595
pageId={pageId}
9696
webTitle={webTitle}
97-
context="ArticleMeta" // TODO: update context to GalleryImage
97+
context="ArticleMeta"
9898
/>
9999
</Island>
100100
</figcaption>

dotcom-rendering/src/components/GalleryImage.tsx

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -16,43 +16,17 @@ type Props = {
1616
};
1717

1818
const styles = css`
19-
${grid.container}
19+
${grid.paddedContainer}
2020
grid-auto-flow: row dense;
21-
column-gap: ${space[5]}px;
2221
2322
${until.tablet} {
2423
border-top: 1px solid ${palette('--article-border')};
2524
padding-top: ${space[1]}px;
2625
}
2726
2827
${from.tablet} {
29-
&::before {
30-
${grid.between('grid-start', 'centre-column-start')}
31-
grid-row: span 2;
32-
content: '';
33-
background-color: ${palette('--article-background')};
34-
border-right: 1px solid ${palette('--article-border')};
35-
}
36-
37-
&::after {
38-
${grid.between('centre-column-end', 'grid-end')}
39-
grid-row: span 2;
40-
content: '';
41-
background-color: ${palette('--article-background')};
42-
border-left: 1px solid ${palette('--article-border')};
43-
}
44-
}
45-
46-
${from.desktop} {
47-
&::after {
48-
${grid.between('right-column-end', 'grid-end')}
49-
}
50-
}
51-
52-
${from.leftCol} {
53-
&::before {
54-
${grid.between('grid-start', 'left-column-start')}
55-
}
28+
border-left: 1px solid ${palette('--article-border')};
29+
border-right: 1px solid ${palette('--article-border')};
5630
}
5731
`;
5832

dotcom-rendering/src/components/Picture.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,10 @@ const galleryBodyImageStyles = css`
488488
}
489489
`;
490490

491+
/**
492+
* This ensures that the image height never goes above 96vh.
493+
* The ratio parameter should be width:height.
494+
*/
491495
const imageMaxWidth = (
492496
design: ArticleDesign,
493497
ratio: number,

0 commit comments

Comments
 (0)