Skip to content

Commit c042bad

Browse files
committed
Add football stat colours to palette
1 parent 9b6420b commit c042bad

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

dotcom-rendering/src/components/FootballMatchStat.stories.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { css } from '@emotion/react';
2-
import { palette, space } from '@guardian/source/foundations';
2+
import { space } from '@guardian/source/foundations';
33
import type { Meta, StoryObj } from '@storybook/react-webpack5';
4+
import { palette } from '../palette';
45
import { FootballMatchStat } from './FootballMatchStat';
56

67
const meta = {
@@ -11,7 +12,9 @@ const meta = {
1112
<div
1213
css={css`
1314
padding: ${space[4]}px;
14-
background-color: ${palette.neutral[97]};
15+
background-color: ${palette(
16+
'--football-live-blog-background',
17+
)};
1518
`}
1619
>
1720
<Story />

dotcom-rendering/src/components/FootballMatchStat.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { css } from '@emotion/react';
22
import {
33
from,
4-
palette,
54
textSansBold14,
65
textSansBold15,
76
textSansBold20,
87
textSansBold28,
98
visuallyHidden,
109
} from '@guardian/source/foundations';
10+
import { palette } from '../palette';
1111

1212
const containerCss = css`
1313
position: relative;
1414
padding: 5px 10px 10px;
15-
border: 1px solid ${palette.neutral[86]};
15+
border: 1px solid ${palette('--footall-match-stat-border')};
1616
border-radius: 6px;
1717
&::before {
1818
position: absolute;
@@ -21,7 +21,7 @@ const containerCss = css`
2121
bottom: 0;
2222
width: 1px;
2323
height: 24px;
24-
background-color: ${palette.neutral[86]};
24+
background-color: ${palette('--footall-match-stat-border')};
2525
}
2626
`;
2727

@@ -43,7 +43,7 @@ const labelCss = css`
4343
${textSansBold14};
4444
grid-area: label;
4545
justify-self: center;
46-
color: ${palette.neutral[7]};
46+
color: ${palette('--footall-match-stat-name')};
4747
${from.desktop} {
4848
${textSansBold15};
4949
}

dotcom-rendering/src/components/FootballMiniMatchStats.stories.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import { css } from '@emotion/react';
2-
import { breakpoints, from, palette } from '@guardian/source/foundations';
2+
import { breakpoints, from } from '@guardian/source/foundations';
33
import type { Meta, StoryObj } from '@storybook/react-webpack5';
4+
import { palette } from '../palette';
45
import { FootballMiniMatchStats as FootballMiniMatchStatsComponent } from './FootballMiniMatchStats';
56

67
const gridCss = css`
7-
background-color: ${palette.neutral[97]};
8+
background-color: ${palette('--football-live-blog-background')};
89
/**
910
* Extremely simplified live blog grid layout as we're only interested in
1011
* the 240px wide left column added at the desktop breakpoint.

dotcom-rendering/src/components/FootballMiniMatchStats.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { css } from '@emotion/react';
2-
import { from, palette } from '@guardian/source/foundations';
2+
import { from } from '@guardian/source/foundations';
33
import {
44
LinkButton,
55
SvgArrowRightStraight,
66
} from '@guardian/source/react-components';
7+
import { palette } from '../palette';
78
import { FootballMatchStat } from './FootballMatchStat';
89

910
const containerCss = css`
@@ -74,7 +75,11 @@ export const FootballMiniMatchStats = ({
7475
size="small"
7576
icon={<SvgArrowRightStraight />}
7677
iconSide="right"
77-
theme={{ backgroundPrimary: palette.sport[400] }}
78+
theme={{
79+
backgroundPrimary: palette(
80+
'--footall-match-stat-button-background',
81+
),
82+
}}
7883
>
7984
<span css={buttonTextCss}>More stats, line-ups and tables</span>
8085
<span css={buttonTextShortCss}>Stats and line ups</span>

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7052,6 +7052,10 @@ const paletteColours = {
70527052
light: () => '#3DB540',
70537053
dark: () => '#3DB540',
70547054
},
7055+
'--football-live-blog-background': {
7056+
light: () => sourcePalette.neutral[97],
7057+
dark: () => sourcePalette.neutral[10],
7058+
},
70557059
'--football-match-hover': {
70567060
light: () => sourcePalette.neutral[93],
70577061
dark: () => sourcePalette.neutral[38],
@@ -7064,6 +7068,18 @@ const paletteColours = {
70647068
light: () => sourcePalette.sport[500],
70657069
dark: () => sourcePalette.sport[500],
70667070
},
7071+
'--footall-match-stat-border': {
7072+
light: () => sourcePalette.neutral[86],
7073+
dark: () => sourcePalette.neutral[20],
7074+
},
7075+
'--footall-match-stat-button-background': {
7076+
light: () => sourcePalette.sport[400],
7077+
dark: () => sourcePalette.sport[400],
7078+
},
7079+
'--footall-match-stat-name': {
7080+
light: () => sourcePalette.neutral[7],
7081+
dark: () => sourcePalette.neutral[86],
7082+
},
70677083
'--football-score-border': {
70687084
light: () => sourcePalette.neutral[7],
70697085
dark: () => sourcePalette.neutral[7],

0 commit comments

Comments
 (0)