Flat for shadcn/ui

Flat is a shadcn/ui theme built around a neutral gray primary color (#8f8f8f) with neutral gray accents (#8f8f8f). The light mode uses a neutral background (#fbf8f8). Dark mode keeps the neutral gray primary (#8f8f8f) on a neutral background (#070404).

Color palette

TokenLightDark
Background
#fbf8f8snow
#070404black
Foreground
#040101black
#faf5f5whitesmoke
Card
#fbf8f8snow
#070404black
Card foreground
#040101black
#faf5f5whitesmoke
Popover
#fbf8f8snow
#070404black
Popover foreground
#040101black
#faf5f5whitesmoke
Primary
#8f8f8fgray
#8f8f8fgray
Primary foreground
#000000black
#000000black
Secondary
#8f8f8fgray
#8f8f8fgray
Secondary foreground
#000000black
#000000black
Muted
#e2dadagainsboro
#251d1dblack
Muted foreground
#463f3fdarkslategray
#c0b9b9silver
Accent
#8f8f8fgray
#8f8f8fgray
Accent foreground
#000000black
#000000black
Destructive
#881d07darkred
#df2f0corangered
Destructive foreground
#fccec5pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#8f8f8fgray
#8f8f8fgray

Contrast

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

Light mode
Text on background19.74:1AAA
Text on card19.74:1AAA
Primary button6.47:1AA
Secondary button6.47:1AA
Muted text7.45:1AAA
Accent6.47:1AA
Destructive6.66:1AA
Dark mode
Text on background18.96:1AAA
Text on card18.96:1AAA
Primary button6.47:1AA
Secondary button6.47:1AA
Muted text8.55:1AAA
Accent6.47:1AA
Destructive4.62:1AA

CSS variables

Paste this into your globals.css to use Flat in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.003 17.215);
  --foreground: oklch(0.083 0.013 20.305);
  --muted: oklch(0.894 0.009 17.334);
  --muted-foreground: oklch(0.374 0.009 17.568);
  --popover: oklch(0.983 0.003 17.215);
  --popover-foreground: oklch(0.083 0.013 20.305);
  --card: oklch(0.983 0.003 17.215);
  --card-foreground: oklch(0.083 0.013 20.305);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.649 0 169.695);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.649 0 169.695);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.649 0 169.695);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.41 0.145 32.709);
  --destructive-foreground: oklch(0.889 0.054 31.285);
  --ring: oklch(0.649 0 169.695);
  --chart-1: oklch(0.649 0 169.695);
  --chart-2: oklch(0.649 0 169.695);
  --chart-3: oklch(0.649 0 169.695);
  --chart-4: oklch(0.675 0 170.538);
  --chart-5: oklch(0.644 0.008 17.365);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.109 0.009 18.664);
  --foreground: oklch(0.974 0.005 17.244);
  --muted: oklch(0.24 0.014 18.135);
  --muted-foreground: oklch(0.792 0.008 17.315);
  --popover: oklch(0.109 0.009 18.664);
  --popover-foreground: oklch(0.974 0.005 17.244);
  --card: oklch(0.109 0.009 18.664);
  --card-foreground: oklch(0.974 0.005 17.244);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.649 0 169.695);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.649 0 169.695);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.649 0 169.695);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.587 0.215 32.302);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.649 0 169.695);
  --chart-1: oklch(0.649 0 169.695);
  --chart-2: oklch(0.649 0 169.695);
  --chart-3: oklch(0.649 0 169.695);
  --chart-4: oklch(0.675 0 170.538);
  --chart-5: oklch(0.644 0.008 17.365);
}