Modern for shadcn/ui

Modern is a shadcn/ui theme built around a muted yellow primary color (#807e5b) with muted green accents (#70805b). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted yellow primary (#807e5b) on a neutral background (#080802).

Color palette

TokenLightDark
Background
#ffffffwhite
#080802black
Foreground
#040401black
#fbfaf9snow
Card
#ffffffwhite
#080802black
Card foreground
#040401black
#fbfaf9snow
Popover
#ffffffwhite
#080802black
Popover foreground
#040401black
#fbfaf9snow
Primary
#807e5bdimgray
#807e5bdimgray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#806c5bdimgray
#806c5bdimgray
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e9e2ddgainsboro
#221b16black
Muted foreground
#564e48darkolivegreen
#b7afa9darkgray
Accent
#70805bdimgray
#70805bdimgray
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#af2f08firebrick
#db3b0aorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#807e5bdimgray
#807e5bdimgray

Contrast

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

Light mode
Text on background20.52:1AAA
Text on card20.52:1AAA
Primary button4.13:1AA Large
Secondary button4.98:1AA
Muted text6.36:1AA
Accent4.25:1AA Large
Destructive6.47:1AA
Dark mode
Text on background19.29:1AAA
Text on card19.29:1AAA
Primary button4.13:1AA Large
Secondary button4.98:1AA
Muted text7.83:1AAA
Accent4.25:1AA Large
Destructive4.51:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.105 0.016 106.964);
  --muted: oklch(0.918 0.011 62.041);
  --muted-foreground: oklch(0.431 0.015 61.73);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.105 0.016 106.964);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.105 0.016 106.964);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.587 0.051 105.331);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.545 0.036 61.232);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.577 0.058 127.803);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.502 0.17 35.139);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.587 0.051 105.331);
  --chart-1: oklch(0.587 0.051 105.331);
  --chart-2: oklch(0.545 0.036 61.232);
  --chart-3: oklch(0.577 0.058 127.803);
  --chart-4: oklch(0.572 0.038 61.224);
  --chart-5: oklch(0.596 0.059 105.499);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.13 0.017 106.567);
  --foreground: oklch(0.986 0.002 103.998);
  --muted: oklch(0.23 0.015 61.261);
  --muted-foreground: oklch(0.759 0.013 61.97);
  --popover: oklch(0.13 0.017 106.567);
  --popover-foreground: oklch(0.986 0.002 103.998);
  --card: oklch(0.13 0.017 106.567);
  --card-foreground: oklch(0.986 0.002 103.998);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.587 0.051 105.331);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.545 0.036 61.232);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.577 0.058 127.803);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.59 0.203 34.856);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.587 0.051 105.331);
  --chart-1: oklch(0.587 0.051 105.331);
  --chart-2: oklch(0.545 0.036 61.232);
  --chart-3: oklch(0.577 0.058 127.803);
  --chart-4: oklch(0.572 0.038 61.224);
  --chart-5: oklch(0.596 0.059 105.499);
}