Black-and-white is a shadcn/ui theme built around a deep pink primary color (#580e3f) with deep green accents (#0e5827). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep pink primary (#580e3f) on a neutral background (#040203).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #040203black |
| Foreground | #000000black | #fdfcfdwhite |
| Card | #ffffffwhite | #040203black |
| Card foreground | #000000black | #fdfcfdwhite |
| Popover | #ffffffwhite | #040203black |
| Popover foreground | #000000black | #fdfcfdwhite |
| Primary | #580e3findigo | #580e3findigo |
| Primary foreground | #f1a7d8plum | #f1a7d8plum |
| Secondary | #0e5827darkgreen | #0e5827darkgreen |
| Secondary foreground | #a7f1c0powderblue | #a7f1c0powderblue |
| Muted | #e2e4e2gainsboro | #1b1d1cblack |
| Muted foreground | #4d5c52darkslategray | #a3b2a8darkgray |
| Accent | #0e5827darkgreen | #0e5827darkgreen |
| Accent foreground | #a7f1c0powderblue | #a7f1c0powderblue |
| Destructive | #662a0bsaddlebrown | #e25f18chocolate |
| Destructive foreground | #f6c6acwheat | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #580e3findigo | #580e3findigo |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 21.00:1 | AAA |
| Text on card | 21.00:1 | AAA |
| Primary button | 7.25:1 | AAA |
| Secondary button | 6.52:1 | AA |
| Muted text | 5.54:1 | AA |
| Accent | 6.52:1 | AA |
| Destructive | 7.14:1 | AAA |
| Text on background | 20.26:1 | AAA |
| Text on card | 20.26:1 | AAA |
| Primary button | 7.25:1 | AAA |
| Secondary button | 6.52:1 | AA |
| Muted text | 7.64:1 | AAA |
| Accent | 6.52:1 | AA |
| Destructive | 3.57:1 | AA Large |
Paste this into your globals.css to use Black-and-white in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0 0 0);
--muted: oklch(0.917 0.004 157.178);
--muted-foreground: oklch(0.458 0.025 156.11);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0 0 0);
--card: oklch(1 0 180);
--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.318 0.118 345.236);
--primary-foreground: oklch(0.814 0.108 339.753);
--secondary: oklch(0.406 0.106 149.187);
--secondary-foreground: oklch(0.897 0.101 154.704);
--accent: oklch(0.406 0.106 149.187);
--accent-foreground: oklch(0.897 0.101 154.704);
--destructive: oklch(0.365 0.095 44.835);
--destructive-foreground: oklch(0.862 0.066 49.765);
--ring: oklch(0.318 0.118 345.236);
--chart-1: oklch(0.318 0.118 345.236);
--chart-2: oklch(0.406 0.106 149.187);
--chart-3: oklch(0.406 0.106 149.187);
--chart-4: oklch(0.447 0.118 148.991);
--chart-5: oklch(0.32 0.121 345.555);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.087 0.011 337.529);
--foreground: oklch(0.992 0.002 337.311);
--muted: oklch(0.229 0.006 156.767);
--muted-foreground: oklch(0.75 0.022 156.653);
--popover: oklch(0.087 0.011 337.529);
--popover-foreground: oklch(0.992 0.002 337.311);
--card: oklch(0.087 0.011 337.529);
--card-foreground: oklch(0.992 0.002 337.311);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.318 0.118 345.236);
--primary-foreground: oklch(0.814 0.108 339.753);
--secondary: oklch(0.406 0.106 149.187);
--secondary-foreground: oklch(0.897 0.101 154.704);
--accent: oklch(0.406 0.106 149.187);
--accent-foreground: oklch(0.897 0.101 154.704);
--destructive: oklch(0.643 0.18 43.333);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.318 0.118 345.236);
--chart-1: oklch(0.318 0.118 345.236);
--chart-2: oklch(0.406 0.106 149.187);
--chart-3: oklch(0.406 0.106 149.187);
--chart-4: oklch(0.447 0.118 148.991);
--chart-5: oklch(0.32 0.121 345.555);
}