@@ -108,7 +101,7 @@ export const CommentCount = ({
aria-label={`${short} Comments`}
>
-
+
{
test('CommentCount', () => {
expect(() =>
- renderToString(
- ,
- ),
+ renderToString(),
).not.toThrow();
});
diff --git a/dotcom-rendering/src/lib/decidePalette.ts b/dotcom-rendering/src/lib/decidePalette.ts
index a8529d59a33..5de21716dd3 100644
--- a/dotcom-rendering/src/lib/decidePalette.ts
+++ b/dotcom-rendering/src/lib/decidePalette.ts
@@ -523,39 +523,6 @@ const backgroundFilterButtonActive = (format: ArticleFormat): string => {
}
};
-const fillCommentCount = (format: ArticleFormat): string => {
- if (
- format.design === ArticleDesign.LiveBlog ||
- format.design === ArticleDesign.DeadBlog
- )
- return neutral[46];
- if (format.theme === ArticleSpecial.Labs) return BLACK;
- if (format.theme === ArticleSpecial.SpecialReport)
- return specialReport[300];
-
- if (format.theme === ArticleSpecial.SpecialReportAlt)
- return palette.specialReportAlt[100];
-
- if (format.design === ArticleDesign.Analysis) {
- switch (format.theme) {
- case Pillar.News:
- return news[300];
- default:
- return pillarPalette[format.theme].main;
- }
- }
- if (format.design === ArticleDesign.Picture) {
- return palette.neutral[86];
- }
- return pillarPalette[format.theme].main;
-};
-
-const fillCommentCountUntilDesktop = (format: ArticleFormat): string => {
- if (format.design === ArticleDesign.LiveBlog) return WHITE;
-
- return fillCommentCount(format);
-};
-
const fillGuardianLogo = (format: ArticleFormat): string => {
if (format.design === ArticleDesign.NewsletterSignup) return WHITE;
@@ -1090,8 +1057,6 @@ export const decidePalette = (
backgroundDynamoSublink(format),
},
fill: {
- commentCount: fillCommentCount(format),
- commentCountUntilDesktop: fillCommentCountUntilDesktop(format),
guardianLogo: fillGuardianLogo(format),
},
border: {
diff --git a/dotcom-rendering/src/palette.ts b/dotcom-rendering/src/palette.ts
index 2234b5d963c..bceb0622871 100644
--- a/dotcom-rendering/src/palette.ts
+++ b/dotcom-rendering/src/palette.ts
@@ -3985,6 +3985,36 @@ const witnessTitleIcon: PaletteFunction = (format) => witnessTitleText(format);
const witnessTitleAuthor: PaletteFunction = (format) =>
witnessTitleText(format);
+const commentCountFill: PaletteFunction = ({ design, theme }) => {
+ if (design === ArticleDesign.LiveBlog || design === ArticleDesign.DeadBlog)
+ return sourcePalette.neutral[46];
+ if (theme === ArticleSpecial.Labs) return sourcePalette.neutral[7];
+ if (theme === ArticleSpecial.SpecialReport)
+ return sourcePalette.specialReport[300];
+
+ if (theme === ArticleSpecial.SpecialReportAlt)
+ return sourcePalette.specialReportAlt[100];
+
+ if (design === ArticleDesign.Analysis) {
+ switch (theme) {
+ case Pillar.News:
+ return sourcePalette.news[300];
+ default:
+ pillarPalette(theme, 400);
+ }
+ }
+ if (design === ArticleDesign.Picture) {
+ return sourcePalette.neutral[86];
+ }
+ return pillarPalette(theme, 400);
+};
+
+const mobileCommentCountFill: PaletteFunction = (format) => {
+ if (format.design === ArticleDesign.LiveBlog)
+ return sourcePalette.neutral[100];
+ return commentCountFill(format);
+};
+
// ----- Palette ----- //
/**
@@ -4616,6 +4646,14 @@ const paletteColours = {
light: witnessTitleAuthor,
dark: witnessTitleAuthor,
},
+ '--comment-count-fill': {
+ light: commentCountFill,
+ dark: commentCountFill,
+ },
+ '--comment-count-mobile-fill': {
+ light: mobileCommentCountFill,
+ dark: mobileCommentCountFill,
+ },
} satisfies PaletteColours;
/**
diff --git a/dotcom-rendering/src/types/palette.ts b/dotcom-rendering/src/types/palette.ts
index 047447fa8d7..6f168d01516 100644
--- a/dotcom-rendering/src/types/palette.ts
+++ b/dotcom-rendering/src/types/palette.ts
@@ -55,8 +55,6 @@ export type Palette = {
dynamoSublink: Colour;
};
fill: {
- commentCount: Colour;
- commentCountUntilDesktop: Colour;
guardianLogo: Colour;
};
border: {