Skip to content

Commit 952357f

Browse files
committed
Use colour for quote icon
1 parent 8a12175 commit 952357f

File tree

3 files changed

+65
-3
lines changed

3 files changed

+65
-3
lines changed

dotcom-rendering/src/components/CardHeadline.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ type Props = {
4848
headlineColour?: string;
4949
/** Optional override of the standard card kicker colour */
5050
kickerColour?: string;
51+
quoteColour?: string;
5152
kickerImage?: PodcastSeriesImage;
5253
};
5354

@@ -190,6 +191,7 @@ export const CardHeadline = ({
190191
isExternalLink,
191192
headlineColour = palette('--card-headline'),
192193
kickerColour = palette('--card-kicker-text'),
194+
quoteColour = palette('--card-quote-icon'),
193195
kickerImage,
194196
}: Props) => {
195197
// The link is only applied directly to the headline if it is a sublink
@@ -220,7 +222,7 @@ export const CardHeadline = ({
220222
image={kickerImage}
221223
/>
222224
)}
223-
{showQuotes && <QuoteIcon colour={kickerColour} />}
225+
{showQuotes && <QuoteIcon colour={quoteColour} />}
224226
<span
225227
css={css`
226228
color: ${headlineColour};

dotcom-rendering/src/components/Masthead/HighlightsCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export const HighlightsCard = ({
157157
showQuotes={showQuotedHeadline}
158158
headlineColour={palette('--highlights-card-headline')}
159159
kickerColour={palette('--highlights-card-kicker-text')}
160+
quoteColour={palette('--highlights-card-quote-icon')}
160161
/>
161162

162163
{!isUndefined(starRating) && (

dotcom-rendering/src/paletteDeclarations.ts

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2603,7 +2603,6 @@ const cardKickerTextLight: PaletteFunction = (format) => {
26032603
return sourcePalette.specialReportAlt[200];
26042604
}
26052605
};
2606-
26072606
const cardKickerTextDark: PaletteFunction = ({ theme }) => {
26082607
switch (theme) {
26092608
case Pillar.News:
@@ -2621,6 +2620,40 @@ const cardKickerTextDark: PaletteFunction = ({ theme }) => {
26212620
}
26222621
};
26232622

2623+
const cardQuoteIconLight: PaletteFunction = (format) => {
2624+
switch (format.theme) {
2625+
case Pillar.Opinion:
2626+
return pillarPalette(format.theme, 300);
2627+
case Pillar.Sport:
2628+
case Pillar.Culture:
2629+
case Pillar.Lifestyle:
2630+
case Pillar.News:
2631+
return pillarPalette(format.theme, 400);
2632+
case ArticleSpecial.Labs:
2633+
return sourcePalette.labs[200];
2634+
case ArticleSpecial.SpecialReport:
2635+
return sourcePalette.news[400];
2636+
case ArticleSpecial.SpecialReportAlt:
2637+
return sourcePalette.specialReportAlt[200];
2638+
}
2639+
};
2640+
const cardQuoteIconDark: PaletteFunction = ({ theme }) => {
2641+
switch (theme) {
2642+
case Pillar.News:
2643+
case Pillar.Lifestyle:
2644+
case Pillar.Sport:
2645+
case Pillar.Culture:
2646+
case Pillar.Opinion:
2647+
return pillarPalette(theme, 500);
2648+
case ArticleSpecial.Labs:
2649+
return sourcePalette.labs[400];
2650+
case ArticleSpecial.SpecialReport:
2651+
return sourcePalette.news[500];
2652+
case ArticleSpecial.SpecialReportAlt:
2653+
return sourcePalette.specialReportAlt[200];
2654+
}
2655+
};
2656+
26242657
const cardBackgroundHover: PaletteFunction = () =>
26252658
transparentColour(sourcePalette.neutral[7], 0.1);
26262659

@@ -5797,10 +5830,28 @@ const highlightsCardHeadlineLight: PaletteFunction = (format) => {
57975830
return sourcePalette.specialReportAlt[200];
57985831
}
57995832
};
5800-
58015833
const highlightsCardHeadlineDark: PaletteFunction = () =>
58025834
sourcePalette.neutral[86];
58035835

5836+
const highlightsCardQuoteIconLight: PaletteFunction = (format) => {
5837+
switch (format.theme) {
5838+
case Pillar.News:
5839+
case Pillar.Opinion:
5840+
case Pillar.Sport:
5841+
case Pillar.Culture:
5842+
case Pillar.Lifestyle:
5843+
return pillarPalette(format.theme, 400);
5844+
case ArticleSpecial.Labs:
5845+
return sourcePalette.labs[200];
5846+
case ArticleSpecial.SpecialReport:
5847+
return sourcePalette.news[400];
5848+
case ArticleSpecial.SpecialReportAlt:
5849+
return sourcePalette.specialReportAlt[200];
5850+
}
5851+
};
5852+
const highlightsCardQuoteIconDark: PaletteFunction = () =>
5853+
sourcePalette.neutral[86];
5854+
58045855
const highlightContainerStartLight: PaletteFunction = () =>
58055856
sourcePalette.neutral[100];
58065857
const highlightContainerStartDark: PaletteFunction = () =>
@@ -6437,6 +6488,10 @@ const paletteColours = {
64376488
light: cardMediaWaveformLight,
64386489
dark: cardMediaWaveformDark,
64396490
},
6491+
'--card-quote-icon': {
6492+
light: cardQuoteIconLight,
6493+
dark: cardQuoteIconDark,
6494+
},
64406495
'--card-sublinks-background': {
64416496
light: cardSublinksBackgroundLight,
64426497
dark: cardSublinksBackgroundDark,
@@ -6958,6 +7013,10 @@ const paletteColours = {
69587013
light: highlightsCardKickerTextLight,
69597014
dark: highlightsCardKickerTextDark,
69607015
},
7016+
'--highlights-card-quote-icon': {
7017+
light: highlightsCardQuoteIconLight,
7018+
dark: highlightsCardQuoteIconDark,
7019+
},
69617020
'--highlights-container-background': {
69627021
light: highlightsContainerBackgroundLight,
69637022
dark: highlightsContainerBackgroundDark,

0 commit comments

Comments
 (0)