Flat for shadcn/ui

Flat is a shadcn/ui theme built around a muted teal primary color (#53746d) with muted yellow accents (#746d53). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted teal primary (#53746d) on a teal-tinted background (#05100d).

Color palette

TokenLightDark
Background
#ffffffwhite
#05100dblack
Foreground
#000000black
#ffffffwhite
Card
#ffffffwhite
#05100dblack
Card foreground
#000000black
#ffffffwhite
Popover
#ffffffwhite
#05100dblack
Popover foreground
#000000black
#ffffffwhite
Primary
#53746ddimgray
#53746ddimgray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#6d5374dimgray
#6d5374dimgray
Secondary foreground
#fdfcfdwhite
#fdfcfdwhite
Muted
#e2dee3gainsboro
#201c21black
Muted foreground
#5c5b5ddimgray
#a4a2a4darkgray
Accent
#746d53dimgray
#746d53dimgray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#cd4a04chocolate
#fa5b05orangered
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#53746ddimgray
#53746ddimgray

Contrast

WCAG 2 contrast ratios between each background and its foreground color.

Light mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button5.12:1AA
Secondary button6.56:1AA
Muted text5.06:1AA
Accent5.17:1AA
Destructive4.57:1AA
Dark mode
Text on background19.36:1AAA
Text on card19.36:1AAA
Primary button5.12:1AA
Secondary button6.56:1AA
Muted text6.63:1AA
Accent5.17:1AA
Destructive6.55:1AA

CSS variables

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.904 0.009 318.887);
  --muted-foreground: oklch(0.473 0.003 318.888);
  --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.532 0.04 179.748);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.481 0.062 318.828);
  --secondary-foreground: oklch(0.992 0.001 318.89);
  --accent: oklch(0.534 0.04 94.454);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.583 0.178 40.967);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.532 0.04 179.748);
  --chart-1: oklch(0.532 0.04 179.748);
  --chart-2: oklch(0.481 0.062 318.828);
  --chart-3: oklch(0.534 0.04 94.454);
  --chart-4: oklch(0.506 0.066 318.827);
  --chart-5: oklch(0.538 0.047 179.356);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.159 0.018 179.716);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.233 0.012 318.872);
  --muted-foreground: oklch(0.715 0.003 318.889);
  --popover: oklch(0.159 0.018 179.716);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.159 0.018 179.716);
  --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.532 0.04 179.748);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.481 0.062 318.828);
  --secondary-foreground: oklch(0.992 0.001 318.89);
  --accent: oklch(0.534 0.04 94.454);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.674 0.208 40.529);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.532 0.04 179.748);
  --chart-1: oklch(0.532 0.04 179.748);
  --chart-2: oklch(0.481 0.062 318.828);
  --chart-3: oklch(0.534 0.04 94.454);
  --chart-4: oklch(0.506 0.066 318.827);
  --chart-5: oklch(0.538 0.047 179.356);
}