Skip to content

fix(web): replace invalid alpha-append tints with color-mix - #203

Merged
SishirP17 merged 1 commit into
mainfrom
fix/color-mix-tints
Aug 18, 2026
Merged

fix(web): replace invalid alpha-append tints with color-mix#203
SishirP17 merged 1 commit into
mainfrom
fix/color-mix-tints

Conversation

@SishirP17

Copy link
Copy Markdown
Collaborator

Twelve places built a translucent chip by string-appending a two-digit hex alpha to a color:

background: `${RISK_COLOR[fraud.riskLevel]}14`

That works on a hex literal. Every color here is a var(--color-*) token, so the result was the literal string "var(--color-accent)14" — an invalid declaration the browser silently drops. The chips lost their background entirely and their colored text fell onto whatever surface was underneath.

The fraud-score pill on the visit review page shows the shape of it: at high risk the label resolves to --color-accent, so an orange label landed on an orange background with no chip behind it. On a <button> the missing background also exposed the gradient from #202.

Affected: VisitReviewPage (background + border), DashboardPage, CaregiverActivityPage (×2), StaffPage, MileageReviewPage, TimeOffReviewPage, SuperAdminPage (×3), InsightsPanel.

What changed

tint() in lib/color.ts composes with color-mix, which works against a custom property. color-mix is already used elsewhere in the app, so this adds no new browser assumption.

Alphas are carried over at equivalent percentages (14 → 8%, 18 → 9%, 33 → 20%, 40 → 25%, 55 → 33%).

Second of five, stacked on #202.

@SishirP17
SishirP17 requested a review from durga710 as a code owner August 18, 2026 22:42
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rayhealth-evv-platform-app Ready Ready Preview Aug 18, 2026 10:53pm

Twelve places built a translucent chip by string-appending a two-digit hex
alpha to a color:

    background: `${RISK_COLOR[fraud.riskLevel]}14`

That only works when the value is a hex literal. Every color here is a
`var(--color-*)` token, so the result was the literal string
"var(--color-accent)14" , an invalid declaration the browser drops. The
chips lost their background entirely and their brand-colored text fell onto
whatever surface was underneath.

The fraud-score pill on the visit review page shows the shape of it: at
`high` risk the label resolves to --color-accent, so an orange label landed
on an orange background with no chip behind it.

Add tint() in lib/color.ts, which composes with color-mix and therefore
works against a custom property, and use it at all twelve sites. color-mix
is already used elsewhere in the app, so this adds no new browser
assumption.
@SishirP17
SishirP17 force-pushed the fix/color-mix-tints branch from ca08e60 to 051b143 Compare August 18, 2026 22:52
@SishirP17
SishirP17 merged commit 106d932 into main Aug 18, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant