Purple is a shadcn/ui theme built around a violet primary color (#551ba7) with green accents (#6da71b). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#551ba7) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #fcfbfewhite | #000000black |
| Foreground | #07030dblack | #f7f6f9whitesmoke |
| Card | #f9f7fdghostwhite | #030303black |
| Card foreground | #050209black | #faf9fbghostwhite |
| Popover | #f9f7fdghostwhite | #030303black |
| Popover foreground | #050209black | #faf9fbghostwhite |
| Primary | #551ba7rebeccapurple | #551ba7rebeccapurple |
| Primary foreground | #f9f6feghostwhite | #f9f6feghostwhite |
| Secondary | #6da71bolivedrab | #6da71bolivedrab |
| Secondary foreground | #000000black | #000000black |
| Muted | #e4e9ddgainsboro | #1d2216black |
| Muted foreground | #4b4e46darkslategray | #b6b9b1silver |
| Accent | #6da71bolivedrab | #6da71bolivedrab |
| Accent foreground | #000000black | #000000black |
| Destructive | #b93404firebrick | #e13f05orangered |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #e8e6eblavender | #1e1b22black |
| Input | #e8e6eblavender | #1e1b22black |
| Ring | #551ba7rebeccapurple | #551ba7rebeccapurple |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.80:1 | AAA |
| Text on card | 19.35:1 | AAA |
| Primary button | 9.34:1 | AAA |
| Secondary button | 7.16:1 | AAA |
| Muted text | 6.84:1 | AA |
| Accent | 7.16:1 | AAA |
| Destructive | 5.90:1 | AA |
| Text on background | 19.50:1 | AAA |
| Text on card | 19.70:1 | AAA |
| Primary button | 9.34:1 | AAA |
| Secondary button | 7.16:1 | AAA |
| Muted text | 8.19:1 | AAA |
| Accent | 7.16:1 | AAA |
| Destructive | 4.26:1 | AA Large |
Paste this into your globals.css to use Purple in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.989 0.005 304.982);
--foreground: oklch(0.112 0.031 306.106);
--muted: oklch(0.926 0.016 125.282);
--muted-foreground: oklch(0.419 0.015 125.552);
--popover: oklch(0.979 0.009 304.917);
--popover-foreground: oklch(0.097 0.027 306.53);
--card: oklch(0.979 0.009 304.917);
--card-foreground: oklch(0.097 0.027 306.53);
--border: oklch(0.927 0.007 304.939);
--input: oklch(0.927 0.007 304.939);
--primary: oklch(0.406 0.199 294.202);
--primary-foreground: oklch(0.978 0.01 304.901);
--secondary: oklch(0.662 0.171 130.848);
--secondary-foreground: oklch(0 0 0);
--accent: oklch(0.662 0.171 130.848);
--accent-foreground: oklch(0 0 0);
--destructive: oklch(0.523 0.176 36.224);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.406 0.199 294.202);
--chart-1: oklch(0.406 0.199 294.202);
--chart-2: oklch(0.662 0.171 130.848);
--chart-3: oklch(0.662 0.171 130.848);
--chart-4: oklch(0.7 0.182 130.902);
--chart-5: oklch(0.406 0.204 293.513);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(0.975 0.003 304.997);
--muted: oklch(0.242 0.022 126.344);
--muted-foreground: oklch(0.782 0.013 125.277);
--popover: oklch(0.092 0 180);
--popover-foreground: oklch(0.983 0.002 305.013);
--card: oklch(0.092 0 180);
--card-foreground: oklch(0.983 0.002 305.013);
--border: oklch(0.229 0.013 304.234);
--input: oklch(0.229 0.013 304.234);
--primary: oklch(0.406 0.199 294.202);
--primary-foreground: oklch(0.978 0.01 304.901);
--secondary: oklch(0.662 0.171 130.848);
--secondary-foreground: oklch(0 0 0);
--accent: oklch(0.662 0.171 130.848);
--accent-foreground: oklch(0 0 0);
--destructive: oklch(0.604 0.206 35.853);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.406 0.199 294.202);
--chart-1: oklch(0.406 0.199 294.202);
--chart-2: oklch(0.662 0.171 130.848);
--chart-3: oklch(0.662 0.171 130.848);
--chart-4: oklch(0.7 0.182 130.902);
--chart-5: oklch(0.406 0.204 293.513);
}