Purple is a shadcn/ui theme built around a muted light purple primary color (#f1edf2) with muted light purple accents (#e4dbe6). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted light purple primary (#f1edf2) on a purple-tinted background (#0a040b).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #0a040bblack |
| Foreground | #0f0312black | #f8f6f8whitesmoke |
| Card | #fcfcfcsnow | #0d060eblack |
| Card foreground | #0b020dblack | #faf9fbghostwhite |
| Popover | #ffffffwhite | #0a040bblack |
| Popover foreground | #0f0312black | #f8f6f8whitesmoke |
| Primary | #f1edf2whitesmoke | #f1edf2whitesmoke |
| Primary foreground | #604965dimgray | #604965dimgray |
| Secondary | #e4dbe6gainsboro | #191419black |
| Secondary foreground | #4f3b54darkslategray | #b6a7b9darkgray |
| Muted | #ece9eclavender | #161316black |
| Muted foreground | #615464dimgray | #a99babdarkgray |
| Accent | #e4dbe6gainsboro | #191419black |
| Accent foreground | #4f3b54darkslategray | #b6a7b9darkgray |
| Destructive | #742f07saddlebrown | #e75d0dchocolate |
| Destructive foreground | #fbcdb2peachpuff | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #f1edf2whitesmoke | #f1edf2whitesmoke |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.15:1 | AAA |
| Text on card | 19.97:1 | AAA |
| Primary button | 6.89:1 | AA |
| Secondary button | 7.47:1 | AAA |
| Muted text | 5.87:1 | AA |
| Accent | 7.47:1 | AAA |
| Destructive | 6.75:1 | AA |
| Text on background | 18.83:1 | AAA |
| Text on card | 19.06:1 | AAA |
| Primary button | 6.89:1 | AA |
| Secondary button | 7.95:1 | AAA |
| Muted text | 7.01:1 | AAA |
| Accent | 7.95:1 | AAA |
| Destructive | 3.50:1 | AA Large |
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.132 0.043 321.809);
--muted: oklch(0.937 0.006 320.541);
--muted-foreground: oklch(0.464 0.031 320.633);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0.132 0.043 321.809);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.119 0.037 322.466);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.951 0.008 320.544);
--primary-foreground: oklch(0.44 0.053 320.699);
--secondary: oklch(0.902 0.017 320.56);
--secondary-foreground: oklch(0.385 0.048 320.703);
--accent: oklch(0.902 0.017 320.56);
--accent-foreground: oklch(0.385 0.048 320.703);
--destructive: oklch(0.396 0.108 44.822);
--destructive-foreground: oklch(0.88 0.063 51.664);
--ring: oklch(0.951 0.008 320.544);
--chart-1: oklch(0.951 0.008 320.544);
--chart-2: oklch(0.902 0.017 320.56);
--chart-3: oklch(0.902 0.017 320.56);
--chart-4: oklch(0.927 0.013 320.552);
--chart-5: oklch(0.951 0.009 320.547);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.125 0.02 321.827);
--foreground: oklch(0.976 0.003 320.537);
--muted: oklch(0.19 0.009 320.602);
--muted-foreground: oklch(0.706 0.028 320.593);
--popover: oklch(0.125 0.02 321.827);
--popover-foreground: oklch(0.976 0.003 320.537);
--card: oklch(0.138 0.023 321.182);
--card-foreground: oklch(0.984 0.002 320.535);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.951 0.008 320.544);
--primary-foreground: oklch(0.44 0.053 320.699);
--secondary: oklch(0.2 0.012 320.621);
--secondary-foreground: oklch(0.747 0.029 320.592);
--accent: oklch(0.2 0.012 320.621);
--accent-foreground: oklch(0.747 0.029 320.592);
--destructive: oklch(0.649 0.187 43.14);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.951 0.008 320.544);
--chart-1: oklch(0.951 0.008 320.544);
--chart-2: oklch(0.2 0.012 320.621);
--chart-3: oklch(0.2 0.012 320.621);
--chart-4: oklch(0.233 0.015 320.63);
--chart-5: oklch(0.951 0.009 320.547);
}