Purple is a shadcn/ui theme built around a vivid violet primary color (#9632eb) with neutral gray accents (#d6d6d6). The light mode uses a neutral background (#f0f0f0). Dark mode keeps the vivid violet primary (#9632eb) on a neutral background (#0f0f0f).
| Token | Light | Dark |
|---|---|---|
| Background | #f0f0f0whitesmoke | #0f0f0fblack |
| Foreground | #0f0f0fblack | #f0f0f0whitesmoke |
| Card | #edededwhitesmoke | #121212black |
| Card foreground | #121212black | #edededwhitesmoke |
| Popover | #edededwhitesmoke | #121212black |
| Popover foreground | #121212black | #edededwhitesmoke |
| Primary | #9632ebblueviolet | #9632ebblueviolet |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #dbdbdbgainsboro | #242424darkslategray |
| Secondary foreground | #242424darkslategray | #dbdbdbgainsboro |
| Muted | #e0e0e0gainsboro | #1f1f1fblack |
| Muted foreground | #1f1f1fblack | #e0e0e0gainsboro |
| Accent | #d6d6d6lightgrey | #242424darkslategray |
| Accent foreground | #0f0f0fblack | #f0f0f0whitesmoke |
| Destructive | #f87272salmon | #f87272salmon |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #e0e0e0gainsboro | #1f1f1fblack |
| Input | #e0e0e0gainsboro | #1f1f1fblack |
| Ring | #9632d7darkorchid | #9632d7darkorchid |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 16.77:1 | AAA |
| Text on card | 16.02:1 | AAA |
| Primary button | 5.31:1 | AA |
| Secondary button | 11.24:1 | AAA |
| Muted text | 12.53:1 | AAA |
| Accent | 13.21:1 | AAA |
| Destructive | 2.74:1 | Fail |
| Text on background | 16.78:1 | AAA |
| Text on card | 16.02:1 | AAA |
| Primary button | 5.31:1 | AA |
| Secondary button | 11.25:1 | AAA |
| Muted text | 12.54:1 | AAA |
| Accent | 13.67:1 | AAA |
| Destructive | 2.74:1 | Fail |
Paste this into your globals.css to use Purple in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.954 0 180);
--foreground: oklch(0.17 0 180);
--muted: oklch(0.908 0 180);
--muted-foreground: oklch(0.238 0 161.565);
--popover: oklch(0.947 0 180);
--popover-foreground: oklch(0.182 0 164.055);
--card: oklch(0.947 0 180);
--card-foreground: oklch(0.182 0 164.055);
--border: oklch(0.908 0 180);
--input: oklch(0.908 0 180);
--primary: oklch(0.561 0.255 303.214);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.892 0 180);
--secondary-foreground: oklch(0.259 0 167.471);
--accent: oklch(0.877 0 180);
--accent-foreground: oklch(0.17 0 180);
--destructive: oklch(0.712 0.165 22.149);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.545 0.236 307.668);
--chart-1: oklch(0.561 0.255 303.214);
--chart-2: oklch(0.892 0 180);
--chart-3: oklch(0.877 0 180);
--chart-4: oklch(0.916 0 180);
--chart-5: oklch(0.561 0.261 302.829);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.17 0 180);
--foreground: oklch(0.954 0 180);
--muted: oklch(0.238 0 161.565);
--muted-foreground: oklch(0.908 0 180);
--popover: oklch(0.182 0 164.055);
--popover-foreground: oklch(0.947 0 180);
--card: oklch(0.182 0 164.055);
--card-foreground: oklch(0.947 0 180);
--border: oklch(0.238 0 161.565);
--input: oklch(0.238 0 161.565);
--primary: oklch(0.561 0.255 303.214);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.259 0 167.471);
--secondary-foreground: oklch(0.892 0 180);
--accent: oklch(0.259 0 167.471);
--accent-foreground: oklch(0.954 0 180);
--destructive: oklch(0.712 0.165 22.149);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.545 0.236 307.668);
--chart-1: oklch(0.561 0.255 303.214);
--chart-2: oklch(0.259 0 167.471);
--chart-3: oklch(0.259 0 167.471);
--chart-4: oklch(0.29 0 180);
--chart-5: oklch(0.561 0.261 302.829);
}