Flat is a shadcn/ui theme built around a vivid deep violet primary color (#1d074f) with vivid deep green accents (#074f1d). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the vivid deep violet primary (#1d074f) on a neutral background (#040307).
| Token | Light | Dark |
|---|---|---|
| Background | #fcfbfewhite | #040307black |
| Foreground | #06040cblack | #f6f5f9whitesmoke |
| Card | #fcfbfewhite | #040307black |
| Card foreground | #06040cblack | #f6f5f9whitesmoke |
| Popover | #fcfbfewhite | #040307black |
| Popover foreground | #06040cblack | #f6f5f9whitesmoke |
| Primary | #1d074fmidnightblue | #1d074fmidnightblue |
| Primary foreground | #b194f5plum | #b194f5plum |
| Secondary | #4f1d07maroon | #4f1d07maroon |
| Secondary foreground | #f5b194burlywood | #f5b194burlywood |
| Muted | #e9ddd8gainsboro | #271b16black |
| Muted foreground | #6f625ddimgray | #a29590rosybrown |
| Accent | #074f1ddarkgreen | #074f1ddarkgreen |
| Accent foreground | #36ec6dmediumseagreen | #36ec6dmediumseagreen |
| Destructive | #b60707firebrick | #e70808red |
| Destructive foreground | #fef0f0lavenderblush | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #1d074fmidnightblue | #1d074fmidnightblue |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.80:1 | AAA |
| Text on card | 19.80:1 | AAA |
| Primary button | 7.03:1 | AAA |
| Secondary button | 7.66:1 | AAA |
| Muted text | 4.41:1 | AA Large |
| Accent | 6.20:1 | AA |
| Destructive | 6.26:1 | AA |
| Text on background | 18.90:1 | AAA |
| Text on card | 18.90:1 | AAA |
| Primary button | 7.03:1 | AAA |
| Secondary button | 7.66:1 | AAA |
| Muted text | 5.75:1 | AA |
| Accent | 6.20:1 | AA |
| Destructive | 4.72:1 | AA |
Paste this into your globals.css to use Flat in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.99 0.003 299.988);
--foreground: oklch(0.116 0.022 300.1);
--muted: oklch(0.906 0.014 44.824);
--muted-foreground: oklch(0.508 0.019 44.645);
--popover: oklch(0.99 0.003 299.988);
--popover-foreground: oklch(0.116 0.022 300.1);
--card: oklch(0.99 0.003 299.988);
--card-foreground: oklch(0.116 0.022 300.1);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.229 0.118 286.319);
--primary-foreground: oklch(0.73 0.14 296.586);
--secondary: oklch(0.304 0.082 41.387);
--secondary-foreground: oklch(0.817 0.09 44.147);
--accent: oklch(0.376 0.105 147.668);
--accent-foreground: oklch(0.83 0.222 148.245);
--destructive: oklch(0.49 0.198 28.89);
--destructive-foreground: oklch(0.967 0.015 17.423);
--ring: oklch(0.229 0.118 286.319);
--chart-1: oklch(0.229 0.118 286.319);
--chart-2: oklch(0.304 0.082 41.387);
--chart-3: oklch(0.376 0.105 147.668);
--chart-4: oklch(0.337 0.094 40.96);
--chart-5: oklch(0.228 0.121 285.62);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.107 0.012 300.151);
--foreground: oklch(0.973 0.006 299.937);
--muted: oklch(0.236 0.021 44.293);
--muted-foreground: oklch(0.68 0.017 44.739);
--popover: oklch(0.107 0.012 300.151);
--popover-foreground: oklch(0.973 0.006 299.937);
--card: oklch(0.107 0.012 300.151);
--card-foreground: oklch(0.973 0.006 299.937);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.229 0.118 286.319);
--primary-foreground: oklch(0.73 0.14 296.586);
--secondary: oklch(0.304 0.082 41.387);
--secondary-foreground: oklch(0.817 0.09 44.147);
--accent: oklch(0.376 0.105 147.668);
--accent-foreground: oklch(0.83 0.222 148.245);
--destructive: oklch(0.585 0.237 28.977);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.229 0.118 286.319);
--chart-1: oklch(0.229 0.118 286.319);
--chart-2: oklch(0.304 0.082 41.387);
--chart-3: oklch(0.376 0.105 147.668);
--chart-4: oklch(0.337 0.094 40.96);
--chart-5: oklch(0.228 0.121 285.62);
}