Skip to content

fix(a11y): improve destructive alert description contrast in v4#10432

Open
galoi wants to merge 1 commit intoshadcn-ui:mainfrom
galoi:fix/#10431-alert-destructive-description-contrast
Open

fix(a11y): improve destructive alert description contrast in v4#10432
galoi wants to merge 1 commit intoshadcn-ui:mainfrom
galoi:fix/#10431-alert-destructive-description-contrast

Conversation

@galoi
Copy link
Copy Markdown

@galoi galoi commented Apr 18, 2026

Summary

  • replace text-destructive/90 with text-destructive for destructive Alert descriptions in new-york-v4
  • align the same Alert variant across the generated v4 style files and published registry JSON
  • update the style token source files so future registry builds keep the accessible color choice

Why

Issue #10431 reports that the destructive Alert description color sits on the WCAG AA threshold against the default white card background. The current text-destructive/90 value reduces contrast enough that downstream accessibility tooling can report a failure for normal body text.

Root Cause

The destructive Alert variant explicitly applies a 90% alpha destructive text color to the description slot. With the documented default theme tokens, that lowers the effective foreground/background contrast to the edge of the AA minimum.

Impact

Destructive Alert descriptions now use the full destructive token instead of the alpha-reduced variant, giving the component more contrast headroom with the default theme while preserving the existing visual intent.

Validation

  • pnpm --filter=shadcn build
  • pnpm --filter=v4 lint
  • pnpm exec prettier --check 'apps/v4/registry/new-york-v4/ui/alert.tsx' 'apps/v4/registry/styles/style-*.css' 'apps/v4/styles/*/ui/alert.tsx' 'apps/v4/styles/*/ui-rtl/alert.tsx' 'apps/v4/public/r/styles/*/alert.json'

Closes #10431

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 18, 2026

Someone is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

@galoi galoi marked this pull request as ready for review April 18, 2026 09:47
@galoi galoi changed the title fix: improve destructive alert description contrast in v4 fix(a11y): improve destructive alert description contrast in v4 Apr 18, 2026
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.

[bug]: Alert destructive description text in new-york-v4 falls below WCAG AA with default theme

1 participant