Skip to content

Commit 9e3df84

Browse files
samejrclaude
andcommitted
fix(webapp): drop the chip ring on the light themes where the chip fills solid
The contrast-chip ring is drawn in currentcolor. On a tinted chip that's the accent, which is the edge it was written for; on a chip that fills solid the label is white, so the ring is a white hairline inset into the fill. Against a dark page that still reads as an edge, but on white it reads as a stray inner border. Cancelled for the light themes only, and only for chips that actually fill - the error badge's bright prominence, the queue health chips, and the Stronger colors preview on the account page. A `contrast-chip-solid` marker carries that, because the two remaining users (limits, private connections) stay tinted under the preference and still want the ring. The error badge marks only `bright`; `subtle` keeps its tint and its ring. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent dc61767 commit 9e3df84

5 files changed

Lines changed: 15 additions & 4 deletions

File tree

apps/webapp/app/components/errors/ErrorStatusBadge.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export function ErrorStatusBadge({
3535
<span
3636
className={cn(
3737
"contrast-chip inline-flex items-center rounded px-2 py-0.5 text-xs font-medium",
38+
// Only `bright` fills solid under the preference, so only it drops the ring.
39+
prominence === "bright" && "contrast-chip-solid",
3840
(prominence === "bright" ? brightStyles : subtleStyles)[status],
3941
className
4042
)}

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ function QueueHealthBadge(health: QueueHealth) {
15841584
return (
15851585
<span
15861586
className={cn(
1587-
"contrast-chip ml-auto inline-flex w-fit items-center rounded px-2 py-0.5 text-xs font-medium",
1587+
"contrast-chip contrast-chip-solid ml-auto inline-flex w-fit items-center rounded px-2 py-0.5 text-xs font-medium",
15881588
QUEUE_HEALTH_STYLES[label]
15891589
)}
15901590
>

apps/webapp/app/routes/account._index/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ function StrongerColorsPreview() {
193193
return (
194194
<span
195195
aria-hidden
196-
className="contrast-chip inline-flex rounded bg-success/10 px-2 py-0.5 text-xs font-medium text-success opacity-0 transition-opacity system:bg-success system:text-white group-hover/preview:opacity-100 group-has-[:focus-visible]/preview:opacity-100"
196+
className="contrast-chip contrast-chip-solid inline-flex rounded bg-success/10 px-2 py-0.5 text-xs font-medium text-success opacity-0 transition-opacity system:bg-success system:text-white group-hover/preview:opacity-100 group-has-[:focus-visible]/preview:opacity-100"
197197
>
198198
Example
199199
</span>

apps/webapp/app/routes/storybook.colors/route.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ function QueueHealthChip({ label, className }: { label: string; className: strin
559559
return (
560560
<span
561561
className={cn(
562-
"contrast-chip inline-flex w-fit items-center rounded px-2 py-0.5 text-xs font-medium",
562+
"contrast-chip contrast-chip-solid inline-flex w-fit items-center rounded px-2 py-0.5 text-xs font-medium",
563563
className
564564
)}
565565
>
@@ -1060,7 +1060,7 @@ export default function Story_() {
10601060
{/* ------------------------------------------------------------------ */}
10611061
<StorySection
10621062
title="5. Tinted chips and badges"
1063-
description="Same pill, same size, same weight — the tint and the text color are the only variables. These already opt into the contrast-chip ring, so the right-hand column shows what that ring does at the current interface-contrast setting."
1063+
description="Same pill, same size, same weight — the tint and the text color are the only variables. These already opt into the contrast-chip ring, so the right-hand column shows what that ring does at the current interface-contrast setting — except where the chip fills solid, which cancels it on the light themes."
10641064
>
10651065
<Audit
10661066
title="Error group statuses"

apps/webapp/app/tailwind.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,15 @@
349349
color-mix(in srgb, currentcolor calc(var(--theme-contrast, 0) * 70%), transparent);
350350
}
351351

352+
/* The ring is drawn in currentcolor, which is white on a chip that fills solid -
353+
fine against a dark page, where it reads as an edge, but on white it reads as a
354+
stray border inset into the fill. Cancelled there, and only for the chips that
355+
actually fill: the tinted ones still need the edge it was written for. */
356+
[data-icon-contrast="true"]:is([data-theme="light"], [data-theme="white"])
357+
.contrast-chip-solid {
358+
box-shadow: none;
359+
}
360+
352361
/*
353362
Code syntax palette - the trigger-dark highlight theme, shared by the shiki
354363
theme (streamdown) and the prism theme (CodeBlock). Consumed from JS via

0 commit comments

Comments
 (0)