purple is a shadcn/ui theme built around a violet primary color (#7e38a3) with purple accents (#a33893). The light mode uses a neutral background (#ffffff). Dark mode keeps the violet primary (#7e38a3) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #000000black |
| Foreground | #0f0416black | #faf9fbghostwhite |
| Card | #fcfcfcsnow | #030303black |
| Card foreground | #0c0311black | #fdfcfdwhite |
| Popover | #fcfcfcsnow | #030303black |
| Popover foreground | #0c0311black | #fdfcfdwhite |
| Primary | #7e38a3rebeccapurple | #7e38a3rebeccapurple |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #4838a3darkslateblue | #4838a3darkslateblue |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #d9d6e5gainsboro | #1c1a29black |
| Muted foreground | #535256darkslategray | #aaa9addarkgray |
| Accent | #a33893mediumvioletred | #a33893mediumvioletred |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #a42f0efirebrick | #ed562ctomato |
| Destructive foreground | #fdece8linen | #ffffffwhite |
| Border | #f3f1f3whitesmoke | #252127darkslategray |
| Input | #f3f1f3whitesmoke | #252127darkslategray |
| Ring | #7e38a3rebeccapurple | #7e38a3rebeccapurple |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.01:1 | AAA |
| Text on card | 19.81:1 | AAA |
| Primary button | 7.04:1 | AAA |
| Secondary button | 8.85:1 | AAA |
| Muted text | 5.43:1 | AA |
| Accent | 5.91:1 | AA |
| Destructive | 6.12:1 | AA |
| Text on background | 20.00:1 | AAA |
| Text on card | 20.20:1 | AAA |
| Primary button | 7.04:1 | AAA |
| Secondary button | 8.85:1 | AAA |
| Muted text | 7.34:1 | AAA |
| Accent | 5.91:1 | AA |
| Destructive | 3.53: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.14 0.044 313.585);
--muted: oklch(0.883 0.021 292.86);
--muted-foreground: oklch(0.442 0.005 293.073);
--popover: oklch(0.992 0 161.565);
--popover-foreground: oklch(0.128 0.039 314.62);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.128 0.039 314.62);
--border: oklch(0.96 0.003 314.202);
--input: oklch(0.96 0.003 314.202);
--primary: oklch(0.484 0.172 311.563);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.425 0.165 283.676);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.527 0.176 334.258);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.481 0.159 35.028);
--destructive-foreground: oklch(0.956 0.019 35.958);
--ring: oklch(0.484 0.172 311.563);
--chart-1: oklch(0.484 0.172 311.563);
--chart-2: oklch(0.425 0.165 283.676);
--chart-3: oklch(0.527 0.176 334.258);
--chart-4: oklch(0.445 0.175 283.57);
--chart-5: oklch(0.483 0.18 311.315);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(0.983 0.004 314.198);
--muted: oklch(0.226 0.029 290.72);
--muted-foreground: oklch(0.737 0.005 293.183);
--popover: oklch(0.092 0 180);
--popover-foreground: oklch(0.991 0.002 314.209);
--card: oklch(0.092 0 180);
--card-foreground: oklch(0.991 0.002 314.209);
--border: oklch(0.254 0.012 313.962);
--input: oklch(0.254 0.012 313.962);
--primary: oklch(0.484 0.172 311.563);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.425 0.165 283.676);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.527 0.176 334.258);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.649 0.194 35.829);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.484 0.172 311.563);
--chart-1: oklch(0.484 0.172 311.563);
--chart-2: oklch(0.425 0.165 283.676);
--chart-3: oklch(0.527 0.176 334.258);
--chart-4: oklch(0.445 0.175 283.57);
--chart-5: oklch(0.483 0.18 311.315);
}