fix(ui): give the neutral score pill a label colour that passes AA

The neutral tone set muted text on the secondary fill, which measures
3.6:1 in the dark theme. The secondary surface's own foreground reads
the same in light and passes in dark.
This commit is contained in:
Marc-André Bombeck committed 2026-10-23 08:18:33 +02:00
1 parent cf61bd1c85
commit 14d0184b63
2 files changed
+5 -2

No files matched your search

@@ -17,7 +17,7 @@ describe("<ScorePill>", () => {
it("defaults to the neutral tone", () => {
const html = renderToStaticMarkup(<ScorePill>Low</ScorePill>);
expect(html).toContain("bg-secondary text-muted-foreground");
expect(html).toContain("bg-secondary text-secondary-foreground");
expect(html).toContain('data-tone="neutral"');
});
+4 -1
View File
@@ -30,7 +30,10 @@ const scorePillVariants = cva(
info: "bg-info/15 text-info",
warning: "bg-warning/15 text-warning",
destructive: "bg-destructive/15 text-destructive",
neutral: "bg-secondary text-muted-foreground",
// The secondary surface's own foreground: muted text on the secondary
// fill measured 3.6:1 in the dark theme, under the AA floor a pill
// label needs.
neutral: "bg-secondary text-secondary-foreground",
},
numeric: {
true: "font-semibold tabular-nums",