Skip to content

Commit 57c3c0d

Browse files
committed
place web meta and disclaimer in a container.
Using the container we can give it a padding-bottom and also share the grid columns and the left border styling.
1 parent b02fcd1 commit 57c3c0d

File tree

4 files changed

+43
-41
lines changed

4 files changed

+43
-41
lines changed

dotcom-rendering/src/components/AffiliateDisclaimer.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { css } from '@emotion/react';
22
import {
3-
from,
43
palette,
54
space,
65
textSans12,
76
textSans14,
87
textSans15,
98
} from '@guardian/source/foundations';
109
import { Hide } from '@guardian/source/react-components';
11-
import { grid } from '../grid';
1210
import { palette as themePalette } from '../palette';
1311

1412
const disclaimerLeftColStyles = css`
@@ -26,25 +24,11 @@ const disclaimerLeftColStyles = css`
2624
const galleryDisclaimerStyles = css`
2725
${textSans12};
2826
line-height: 1.5;
29-
${grid.column.centre}
30-
padding-bottom: ${space[6]}px;
3127
color: ${themePalette('--affiliate-disclaimer-text')};
32-
${from.tablet} {
33-
position: relative;
34-
&::before {
35-
content: '';
36-
position: absolute;
37-
left: -10px;
38-
top: 0;
39-
bottom: 0;
40-
width: 1px;
41-
background-color: ${themePalette('--article-border')};
42-
}
43-
}
4428
a {
4529
color: ${themePalette('--affiliate-disclaimer-text')};
4630
transition: border-color 0.15s ease-out;
47-
border-bottom: 1px solid #707070;
31+
border-bottom: 1px solid ${palette.neutral[46]};
4832
text-decoration: none;
4933
}
5034
a:hover {

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

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { css } from '@emotion/react';
22
import { between, from, space, until } from '@guardian/source/foundations';
33
import { StraightLines } from '@guardian/source-development-kitchen/react-components';
4-
import { grid } from '../../src/grid';
54
import type { FEArticle } from '../frontend/feArticle';
65
import { interactiveLegacyClasses } from '../layouts/lib/interactiveLegacyStyling';
76
import {
@@ -184,28 +183,11 @@ export const metaContainer = (format: ArticleFormat) => {
184183
}
185184
`;
186185
case ArticleDesign.LiveBlog:
187-
case ArticleDesign.DeadBlog: {
186+
case ArticleDesign.DeadBlog:
187+
case ArticleDesign.Gallery: {
188188
return '';
189189
}
190-
case ArticleDesign.Gallery:
191-
return css`
192-
${grid.column.centre}
193-
padding-bottom: ${space[3]}px;
194-
${from.tablet} {
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-
}
207-
}
208-
`;
190+
209191
default:
210192
return defaultMargins;
211193
}

dotcom-rendering/src/components/Caption.tsx

Lines changed: 15 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
space,
56
textSans12,
@@ -211,10 +212,24 @@ const captionLink = css`
211212

212213
const galleryStyles = css`
213214
${grid.column.centre}
215+
margin-bottom: 0;
216+
padding-bottom: 6px;
214217
${from.leftCol} {
215218
${grid.column.left}
216219
grid-row-start: 8;
217220
}
221+
${between.tablet.and.leftCol} {
222+
position: relative;
223+
&::before {
224+
content: '';
225+
position: absolute;
226+
left: -10px;
227+
top: 0;
228+
bottom: 0;
229+
width: 1px;
230+
background-color: ${palette('--article-border')};
231+
}
232+
}
218233
`;
219234

220235
const CameraIcon = ({ format }: IconProps) => {

dotcom-rendering/src/layouts/GalleryLayout.tsx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import { css } from '@emotion/react';
2-
import { from, palette as sourcePalette } from '@guardian/source/foundations';
2+
import {
3+
from,
4+
palette as sourcePalette,
5+
space,
6+
} from '@guardian/source/foundations';
37
import { GalleryAffiliateDisclaimer } from '../components/AffiliateDisclaimer';
48
import { AppsFooter } from '../components/AppsFooter.importable';
59
import { ArticleHeadline } from '../components/ArticleHeadline';
@@ -52,6 +56,23 @@ const headerStyles = css`
5256
}
5357
`;
5458

59+
const webMetaAndDisclaimerContainer = css`
60+
${grid.column.centre}
61+
padding-bottom: ${space[6]}px;
62+
${from.tablet} {
63+
position: relative;
64+
&::before {
65+
content: '';
66+
position: absolute;
67+
left: -10px;
68+
top: 0;
69+
bottom: 0;
70+
width: 1px;
71+
background-color: ${palette('--article-border')};
72+
}
73+
}
74+
`;
75+
5576
export const GalleryLayout = (props: WebProps | AppProps) => {
5677
const gallery = props.gallery;
5778
const frontendData = gallery.frontendData;
@@ -124,7 +145,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
124145
isMainMedia={true}
125146
/>
126147
{isWeb ? (
127-
<>
148+
<div css={webMetaAndDisclaimerContainer}>
128149
<ArticleMeta
129150
branding={
130151
frontendData.commercialProperties[
@@ -151,7 +172,7 @@ export const GalleryLayout = (props: WebProps | AppProps) => {
151172
{!!frontendData.affiliateLinksDisclaimer && (
152173
<GalleryAffiliateDisclaimer />
153174
)}
154-
</>
175+
</div>
155176
) : null}
156177

157178
{isApps ? (

0 commit comments

Comments
 (0)