Purple is a shadcn/ui theme built around a vivid violet primary color (#4a0ca7) with vivid green accents (#0ca74a). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid violet primary (#4a0ca7) on a violet-tinted background (#090410).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #090410black |
| Foreground | #0b0415black | #f7f5f9whitesmoke |
| Card | #fcfcfcsnow | #0b0514black |
| Card foreground | #090311black | #faf9fbghostwhite |
| Popover | #ffffffwhite | #090410black |
| Popover foreground | #0b0415black | #f7f5f9whitesmoke |
| Primary | #4a0ca7indigo | #4a0ca7indigo |
| Primary foreground | #f0e7fdlavender | #f0e7fdlavender |
| Secondary | #a74a0csaddlebrown | #a74a0csaddlebrown |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #f1e6dfantiquewhite | #20150eblack |
| Muted foreground | #695f59dimgray | #a69d96darkgray |
| Accent | #0ca74aseagreen | #0ca74aseagreen |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #6a250cmaroon | #e85e2cchocolate |
| Destructive foreground | #f6c3b1lightpink | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #4a0ca7indigo | #4a0ca7indigo |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.14:1 | AAA |
| Text on card | 19.89:1 | AAA |
| Primary button | 9.25:1 | AAA |
| Secondary button | 5.80:1 | AA |
| Muted text | 5.07:1 | AA |
| Accent | 3.16:1 | AA Large |
| Destructive | 7.12:1 | AAA |
| Text on background | 18.69:1 | AAA |
| Text on card | 19.10:1 | AAA |
| Primary button | 9.25:1 | AAA |
| Secondary button | 5.80:1 | AA |
| Muted text | 6.70:1 | AA |
| Accent | 3.16:1 | AA Large |
| Destructive | 6.04:1 | AA |
Paste this into your globals.css to use Purple in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.134 0.04 301.914);
--muted: oklch(0.932 0.016 56.203);
--muted-foreground: oklch(0.494 0.015 56.003);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0.134 0.04 301.914);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.124 0.035 303.729);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.382 0.209 289.605);
--primary-foreground: oklch(0.942 0.031 303.873);
--secondary: oklch(0.521 0.139 46.921);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.637 0.176 149.158);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.363 0.105 38.721);
--destructive-foreground: oklch(0.859 0.064 40.92);
--ring: oklch(0.382 0.209 289.605);
--chart-1: oklch(0.382 0.209 289.605);
--chart-2: oklch(0.521 0.139 46.921);
--chart-3: oklch(0.637 0.176 149.158);
--chart-4: oklch(0.553 0.148 46.732);
--chart-5: oklch(0.384 0.212 288.858);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.126 0.031 303.765);
--foreground: oklch(0.974 0.006 304.264);
--muted: oklch(0.208 0.023 54.791);
--muted-foreground: oklch(0.701 0.014 56.155);
--popover: oklch(0.126 0.031 303.765);
--popover-foreground: oklch(0.974 0.006 304.264);
--card: oklch(0.137 0.036 302.033);
--card-foreground: oklch(0.982 0.004 304.291);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.382 0.209 289.605);
--primary-foreground: oklch(0.942 0.031 303.873);
--secondary: oklch(0.521 0.139 46.921);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.637 0.176 149.158);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.651 0.182 39.012);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.382 0.209 289.605);
--chart-1: oklch(0.382 0.209 289.605);
--chart-2: oklch(0.521 0.139 46.921);
--chart-3: oklch(0.637 0.176 149.158);
--chart-4: oklch(0.553 0.148 46.732);
--chart-5: oklch(0.384 0.212 288.858);
}