Skip to content

Commit 319bc0c

Browse files
committed
Implement dark mode colours
1 parent d0e70a6 commit 319bc0c

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

dotcom-rendering/src/components/StackedProducts.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { css } from '@emotion/react';
2-
import { palette, space, textSans15 } from '@guardian/source/foundations';
2+
import { space, textSans15 } from '@guardian/source/foundations';
33
import {
44
SvgChevronDownSingle,
55
SvgChevronUpSingle,
@@ -8,6 +8,7 @@ import { useState } from 'react';
88
import type { ArticleFormat } from '../lib/articleFormat';
99
import type { ProductBlockElement } from '../types/content';
1010
import { HorizontalSummaryProductCard } from './HorizontalSummaryProductCard';
11+
import { palette } from '../palette';
1112

1213
const showAllButtonStyles = css`
1314
background-color: transparent;
@@ -17,15 +18,17 @@ const showAllButtonStyles = css`
1718

1819
const showAllTextStyles = css`
1920
${textSans15};
20-
color: ${palette.lifestyle[400]};
21+
color: ${palette('--product-card-read-more')};
2122
font-weight: 700;
22-
border-bottom: 1px solid ${palette.neutral[86]};
23+
text-decoration-line: underline;
24+
text-decoration-color: ${palette('--product-card-read-more-decoration')};
25+
text-underline-offset: 20%;
2326
padding-right: ${space[1]}px;
2427
`;
2528

2629
const cardCounterStyles = css`
2730
${textSans15};
28-
color: ${palette.neutral[46]};
31+
color: ${palette('--product-card-count')};
2932
font-weight: 700;
3033
`;
3134

@@ -79,12 +82,16 @@ export const StackedProducts = ({
7982
{isExpanded ? (
8083
<SvgChevronUpSingle
8184
size="xsmall"
82-
theme={{ fill: palette.lifestyle[400] }}
85+
theme={{
86+
fill: palette('--product-card-read-more'),
87+
}}
8388
/>
8489
) : (
8590
<SvgChevronDownSingle
8691
size="xsmall"
87-
theme={{ fill: palette.lifestyle[400] }}
92+
theme={{
93+
fill: palette('--product-card-read-more'),
94+
}}
8895
/>
8996
)}
9097
</button>

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5148,6 +5148,8 @@ const productCardReadMoreDark: PaletteFunction = () =>
51485148
sourcePalette.lifestyle[600];
51495149
const productCardReadMoreDecoration: PaletteFunction = () =>
51505150
sourcePalette.neutral[86];
5151+
const productCardCountLight: PaletteFunction = () => sourcePalette.neutral[46];
5152+
const productCardCountDark: PaletteFunction = () => sourcePalette.neutral[97];
51515153

51525154
const privacyTextRegularLight: PaletteFunction = () => sourcePalette.neutral[7];
51535155
const privacyTextDark: PaletteFunction = () => sourcePalette.neutral[86];
@@ -7649,6 +7651,10 @@ const paletteColours = {
76497651
light: productCardReadMoreDecoration,
76507652
dark: productCardReadMoreDecoration,
76517653
},
7654+
'--product-card-count': {
7655+
light: productCardCountLight,
7656+
dark: productCardCountDark,
7657+
},
76527658
'--pullquote-background': {
76537659
light: pullQuoteBackgroundLight,
76547660
dark: pullQuoteBackgroundDark,

0 commit comments

Comments
 (0)