style: :art: improve contrast for destructive color in dark mode
Related to https://github.com/shadcn-ui/ui/pull/282, but it was closed and not fixed
Before
Not enough contrast with background
After
@flixlix is attempting to deploy a commit to the shadcn-pro Team on Vercel.
A member of the Team first needs to authorize it.
For my own projects, I've decided to go with the following tailwind colors for appropriate contrast on text-based destructive states (and error messages):
bg-white text-red-600 dark:bg-zinc-950 dark:text-red-500
WCAG 2.0 level AA requires a contrast ratio of at least 4.5:1 for normal text.
Any lighter on the red in light mode (or darker in dark mode) results in the following contrast ratios:
Dark mode is better than light mode, but both are still below the minimum required contrast ratio of 4.5:1.