Flat is a shadcn/ui theme built around a near-black primary color (#00040a) with near-black accents (#040a00). The light mode uses a neutral background (#ffffff). Dark mode keeps the near-black primary (#00040a) on a blue-tinted background (#04070b).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #04070bblack |
| Foreground | #000000black | #f5f7fawhitesmoke |
| Card | #ffffffwhite | #04070bblack |
| Card foreground | #000000black | #f5f7fawhitesmoke |
| Popover | #ffffffwhite | #04070bblack |
| Popover foreground | #000000black | #f5f7fawhitesmoke |
| Primary | #00040ablack | #00040ablack |
| Primary foreground | #4592f7cornflowerblue | #4592f7cornflowerblue |
| Secondary | #0a0004black | #0a0004black |
| Secondary foreground | #f74592deeppink | #f74592deeppink |
| Muted | #ece4e7linen | #1b1316black |
| Muted foreground | #6d5a62dimgray | #a5929arosybrown |
| Accent | #040a00black | #040a00black |
| Accent foreground | #5ece09lawngreen | #5ece09lawngreen |
| Destructive | #ca3f0cfirebrick | #f2551corangered |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #00040ablack | #00040ablack |
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 | 6.54:1 | AA |
| Secondary button | 6.12:1 | AA |
| Muted text | 5.11:1 | AA |
| Accent | 9.83:1 | AAA |
| Destructive | 4.96:1 | AA |
| Text on background | 18.79:1 | AAA |
| Text on card | 18.79:1 | AAA |
| Primary button | 6.54:1 | AA |
| Secondary button | 6.12:1 | AA |
| Muted text | 6.23:1 | AA |
| Accent | 9.83:1 | AAA |
| Destructive | 3.44:1 | AA Large |
Paste this into your globals.css to use Flat in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0 0 0);
--muted: oklch(0.926 0.01 349.035);
--muted-foreground: oklch(0.488 0.029 350.313);
--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.106 0.022 240.796);
--primary-foreground: oklch(0.661 0.169 256.276);
--secondary: oklch(0.098 0.036 348.1);
--secondary-foreground: oklch(0.669 0.222 358.797);
--accent: oklch(0.132 0.032 128.98);
--accent-foreground: oklch(0.754 0.227 137.096);
--destructive: oklch(0.565 0.184 36.851);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.106 0.022 240.796);
--chart-1: oklch(0.106 0.022 240.796);
--chart-2: oklch(0.098 0.036 348.1);
--chart-3: oklch(0.132 0.032 128.98);
--chart-4: oklch(0.142 0.053 353.432);
--chart-5: oklch(0.106 0.022 240.263);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.127 0.013 248.033);
--foreground: oklch(0.975 0.004 254.979);
--muted: oklch(0.198 0.015 350.749);
--muted-foreground: oklch(0.679 0.027 349.789);
--popover: oklch(0.127 0.013 248.033);
--popover-foreground: oklch(0.975 0.004 254.979);
--card: oklch(0.127 0.013 248.033);
--card-foreground: oklch(0.975 0.004 254.979);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.106 0.022 240.796);
--primary-foreground: oklch(0.661 0.169 256.276);
--secondary: oklch(0.098 0.036 348.1);
--secondary-foreground: oklch(0.669 0.222 358.797);
--accent: oklch(0.132 0.032 128.98);
--accent-foreground: oklch(0.754 0.227 137.096);
--destructive: oklch(0.656 0.202 37.869);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.106 0.022 240.796);
--chart-1: oklch(0.106 0.022 240.796);
--chart-2: oklch(0.098 0.036 348.1);
--chart-3: oklch(0.132 0.032 128.98);
--chart-4: oklch(0.142 0.053 353.432);
--chart-5: oklch(0.106 0.022 240.263);
}