Required is a shadcn/ui theme built around a violet primary color (#8e62df) with light violet accents (#cac0dd). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#8e62df) on a violet-tinted background (#07040b).
| Token | Light | Dark |
|---|---|---|
| Background | #fcfbfewhite | #07040bblack |
| Foreground | #0b0614black | #ffffffwhite |
| Card | #f9f7fdghostwhite | #09060eblack |
| Card foreground | #090510black | #ffffffwhite |
| Popover | #f9f7fdghostwhite | #09060eblack |
| Popover foreground | #090510black | #ffffffwhite |
| Primary | #8e62dfmediumpurple | #8e62dfmediumpurple |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #e1dde9gainsboro | #323036darkslategray |
| Secondary foreground | #463b59darkslategray | #cbc9cflightgrey |
| Muted | #e4e1eagainsboro | #18151eblack |
| Muted foreground | #545355dimgray | #abaaacdarkgray |
| Accent | #cac0ddthistle | #443d51darkslategray |
| Accent foreground | #312546darkslategray | #dfdce5gainsboro |
| Destructive | #773108saddlebrown | #f28140coral |
| Destructive foreground | #fad0b7peachpuff | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #8e62dfmediumpurple | #8e62dfmediumpurple |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.40:1 | AAA |
| Text on card | 19.00:1 | AAA |
| Primary button | 4.22:1 | AA Large |
| Secondary button | 7.76:1 | AAA |
| Muted text | 5.91:1 | AA |
| Accent | 8.15:1 | AAA |
| Destructive | 6.62:1 | AA |
| Text on background | 20.33:1 | AAA |
| Text on card | 20.11:1 | AAA |
| Primary button | 4.22:1 | AA Large |
| Secondary button | 7.90:1 | AAA |
| Muted text | 7.79:1 | AAA |
| Accent | 7.58:1 | AAA |
| Destructive | 7.99:1 | AAA |
Paste this into your globals.css to use Required in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.99 0.004 302.157);
--foreground: oklch(0.138 0.032 299.781);
--muted: oklch(0.915 0.013 301.994);
--muted-foreground: oklch(0.445 0.003 302.114);
--popover: oklch(0.98 0.007 302.099);
--popover-foreground: oklch(0.127 0.027 301.424);
--card: oklch(0.98 0.007 302.099);
--card-foreground: oklch(0.127 0.027 301.424);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.602 0.183 296.679);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.905 0.016 301.942);
--secondary-foreground: oklch(0.376 0.051 300.023);
--accent: oklch(0.825 0.042 301.421);
--accent-foreground: oklch(0.295 0.058 298.919);
--destructive: oklch(0.405 0.11 44.982);
--destructive-foreground: oklch(0.887 0.058 51.75);
--ring: oklch(0.602 0.183 296.679);
--chart-1: oklch(0.602 0.183 296.679);
--chart-2: oklch(0.905 0.016 301.942);
--chart-3: oklch(0.825 0.042 301.421);
--chart-4: oklch(0.931 0.011 302.023);
--chart-5: oklch(0.599 0.19 296.334);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.119 0.018 302.64);
--foreground: oklch(1 0 180);
--muted: oklch(0.203 0.019 300.763);
--muted-foreground: oklch(0.739 0.002 302.161);
--popover: oklch(0.132 0.021 301.587);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.132 0.021 301.587);
--card-foreground: oklch(1 0 180);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.602 0.183 296.679);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.315 0.009 301.751);
--secondary-foreground: oklch(0.84 0.007 302.078);
--accent: oklch(0.377 0.035 300.751);
--accent-foreground: oklch(0.9 0.012 302.004);
--destructive: oklch(0.719 0.158 48.196);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.602 0.183 296.679);
--chart-1: oklch(0.602 0.183 296.679);
--chart-2: oklch(0.315 0.009 301.751);
--chart-3: oklch(0.377 0.035 300.751);
--chart-4: oklch(0.344 0.01 301.737);
--chart-5: oklch(0.599 0.19 296.334);
}