Black-and-white is a shadcn/ui theme built around a violet primary color (#b391d4) with purple accents (#d491d4). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#b391d4) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #fcfbfewhite | #000000black |
| Foreground | #000000black | #ffffffwhite |
| Card | #faf8fcghostwhite | #030303black |
| Card foreground | #000000black | #ffffffwhite |
| Popover | #faf8fcghostwhite | #030303black |
| Popover foreground | #000000black | #ffffffwhite |
| Primary | #b391d4plum | #b391d4plum |
| Primary foreground | #1a0e25black | #1a0e25black |
| Secondary | #9191d4mediumpurple | #9191d4mediumpurple |
| Secondary foreground | #0e0e25black | #0e0e25black |
| Muted | #e7e7f4lavender | #0b0b18black |
| Muted foreground | #41414edarkslategray | #b1b1besilver |
| Accent | #d491d4plum | #d491d4plum |
| Accent foreground | #250e25black | #250e25black |
| Destructive | #ab0803darkred | #e20b03red |
| Destructive foreground | #ffe2e1mistyrose | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #b391d4plum | #b391d4plum |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.41:1 | AAA |
| Text on card | 19.83:1 | AAA |
| Primary button | 6.96:1 | AA |
| Secondary button | 6.49:1 | AA |
| Muted text | 8.17:1 | AAA |
| Accent | 7.53:1 | AAA |
| Destructive | 6.22:1 | AA |
| Text on background | 21.00:1 | AAA |
| Text on card | 20.67:1 | AAA |
| Primary button | 6.96:1 | AA |
| Secondary button | 6.49:1 | AA |
| Muted text | 9.18:1 | AAA |
| Accent | 7.53:1 | AAA |
| Destructive | 4.90:1 | AA |
Paste this into your globals.css to use Black-and-white in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.99 0.003 308.422);
--foreground: oklch(0 0 0);
--muted: oklch(0.931 0.017 286.059);
--muted-foreground: oklch(0.38 0.022 285.32);
--popover: oklch(0.981 0.007 308.383);
--popover-foreground: oklch(0 0 0);
--card: oklch(0.981 0.007 308.383);
--card-foreground: oklch(0 0 0);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.711 0.102 306.836);
--primary-foreground: oklch(0.193 0.046 305.596);
--secondary: oklch(0.682 0.099 283.479);
--secondary-foreground: oklch(0.18 0.045 280.837);
--accent: oklch(0.745 0.12 326.696);
--accent-foreground: oklch(0.21 0.053 327.262);
--destructive: oklch(0.468 0.188 29.497);
--destructive-foreground: oklch(0.936 0.032 20.101);
--ring: oklch(0.711 0.102 306.836);
--chart-1: oklch(0.711 0.102 306.836);
--chart-2: oklch(0.682 0.099 283.479);
--chart-3: oklch(0.745 0.12 326.696);
--chart-4: oklch(0.715 0.088 283.959);
--chart-5: oklch(0.708 0.109 306.711);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(1 0 180);
--muted: oklch(0.159 0.027 282.894);
--muted-foreground: oklch(0.765 0.018 285.962);
--popover: oklch(0.092 0 180);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.092 0 180);
--card-foreground: oklch(1 0 180);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.711 0.102 306.836);
--primary-foreground: oklch(0.193 0.046 305.596);
--secondary: oklch(0.682 0.099 283.479);
--secondary-foreground: oklch(0.18 0.045 280.837);
--accent: oklch(0.745 0.12 326.696);
--accent-foreground: oklch(0.21 0.053 327.262);
--destructive: oklch(0.576 0.233 29.42);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.711 0.102 306.836);
--chart-1: oklch(0.711 0.102 306.836);
--chart-2: oklch(0.682 0.099 283.479);
--chart-3: oklch(0.745 0.12 326.696);
--chart-4: oklch(0.715 0.088 283.959);
--chart-5: oklch(0.708 0.109 306.711);
}