purple is a shadcn/ui theme built around a vivid indigo primary color (#8789f7) with muted light indigo accents (#d3d3e4). The light mode uses a neutral background (#fbfbfe). Dark mode keeps the vivid indigo primary (#8789f7) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #fbfbfeghostwhite | #000000black |
| Foreground | #000000black | #f9f9fbghostwhite |
| Card | #fbfbfeghostwhite | #000000black |
| Card foreground | #000000black | #f9f9fbghostwhite |
| Popover | #fbfbfeghostwhite | #000000black |
| Popover foreground | #000000black | #f9f9fbghostwhite |
| Primary | #8789f7mediumslateblue | #8789f7mediumslateblue |
| Primary foreground | #050648midnightblue | #050648midnightblue |
| Secondary | #e8e8eelavender | #212127black |
| Secondary foreground | #45465edarkslategray | #b7b8c2silver |
| Muted | #e7e7f3lavender | #0c0c18black |
| Muted foreground | #57585bdimgray | #a4a4a8darkgray |
| Accent | #d3d3e4gainsboro | #2f2f41darkslategray |
| Accent foreground | #333452darkslategray | #cacad8lightgrey |
| Destructive | #651306maroon | #de290dorangered |
| Destructive foreground | #faafa3lightpink | #ffffffwhite |
| Border | #e6e6eblavender | #17171cblack |
| Input | #e6e6eblavender | #17171cblack |
| Ring | #8789f7mediumslateblue | #8789f7mediumslateblue |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.35:1 | AAA |
| Text on card | 20.35:1 | AAA |
| Primary button | 6.18:1 | AA |
| Secondary button | 7.48:1 | AAA |
| Muted text | 5.81:1 | AA |
| Accent | 8.12:1 | AAA |
| Destructive | 7.11:1 | AAA |
| Text on background | 19.97:1 | AAA |
| Text on card | 19.97:1 | AAA |
| Primary button | 6.18:1 | AA |
| Secondary button | 8.13:1 | AAA |
| Muted text | 7.82:1 | AAA |
| Accent | 8.03:1 | AAA |
| Destructive | 4.75:1 | AA |
Paste this into your globals.css to use purple in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.989 0.003 285.556);
--foreground: oklch(0 0 0);
--muted: oklch(0.932 0.016 285.305);
--muted-foreground: oklch(0.46 0.006 285.396);
--popover: oklch(0.989 0.003 285.556);
--popover-foreground: oklch(0 0 0);
--card: oklch(0.989 0.003 285.556);
--card-foreground: oklch(0 0 0);
--border: oklch(0.925 0.007 285.487);
--input: oklch(0.925 0.007 285.487);
--primary: oklch(0.678 0.16 280.5);
--primary-foreground: oklch(0.196 0.116 268.082);
--secondary: oklch(0.932 0.008 285.461);
--secondary-foreground: oklch(0.403 0.04 283.68);
--accent: oklch(0.873 0.022 285.155);
--accent-foreground: oklch(0.337 0.052 282.465);
--destructive: oklch(0.333 0.118 31.811);
--destructive-foreground: oklch(0.822 0.09 28.881);
--ring: oklch(0.678 0.16 280.5);
--chart-1: oklch(0.678 0.16 280.5);
--chart-2: oklch(0.932 0.008 285.461);
--chart-3: oklch(0.873 0.022 285.155);
--chart-4: oklch(0.957 0.005 285.523);
--chart-5: oklch(0.675 0.166 280.257);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(0.983 0.002 285.573);
--muted: oklch(0.161 0.025 282.454);
--muted-foreground: oklch(0.72 0.005 285.492);
--popover: oklch(0 0 0);
--popover-foreground: oklch(0.983 0.002 285.573);
--card: oklch(0 0 0);
--card-foreground: oklch(0.983 0.002 285.573);
--border: oklch(0.206 0.011 284.633);
--input: oklch(0.206 0.011 284.633);
--primary: oklch(0.678 0.16 280.5);
--primary-foreground: oklch(0.196 0.116 268.082);
--secondary: oklch(0.25 0.011 284.837);
--secondary-foreground: oklch(0.784 0.015 285.279);
--accent: oklch(0.314 0.031 283.68);
--accent-foreground: oklch(0.843 0.02 285.187);
--destructive: oklch(0.58 0.217 31.321);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.678 0.16 280.5);
--chart-1: oklch(0.678 0.16 280.5);
--chart-2: oklch(0.25 0.011 284.837);
--chart-3: oklch(0.314 0.031 283.68);
--chart-4: oklch(0.28 0.012 284.792);
--chart-5: oklch(0.675 0.166 280.257);
}