Criterion for shadcn/ui

Criterion is a shadcn/ui theme built around a muted green primary color (#cbd0ae) with muted green accents (#bad0ae). The light mode uses a neutral background (#fbfcf8). Dark mode keeps the muted green primary (#cbd0ae) on a neutral background (#070802).

Color palette

TokenLightDark
Background
#fbfcf8snow
#070802black
Foreground
#121406black
#ffffffwhite
Card
#f9fbf4whitesmoke
#0b0c03black
Card foreground
#0e1004black
#ffffffwhite
Popover
#fbfcf8snow
#070802black
Popover foreground
#121406black
#ffffffwhite
Primary
#cbd0aesilver
#cbd0aesilver
Primary foreground
#2d311cdarkslategray
#2d311cdarkslategray
Secondary
#d0c5aesilver
#d0c5aesilver
Secondary foreground
#312a1cdarkslategray
#312a1cdarkslategray
Muted
#e2dcd0gainsboro
#2f291ddarkslategray
Muted foreground
#6a665cdimgray
#a39e95darkgray
Accent
#bad0aesilver
#bad0aesilver
Accent foreground
#23311cdarkslategray
#23311cdarkslategray
Destructive
#990a0adarkred
#f22c2ccrimson
Destructive foreground
#fdd9d9mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#cbd0aesilver
#cbd0aesilver

Contrast

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

Light mode
Text on background18.07:1AAA
Text on card18.36:1AAA
Primary button8.42:1AAA
Secondary button8.31:1AAA
Muted text4.18:1AA Large
Accent8.34:1AAA
Destructive6.68:1AA
Dark mode
Text on background20.10:1AAA
Text on card19.67:1AAA
Primary button8.42:1AAA
Secondary button8.31:1AAA
Muted text5.40:1AA
Accent8.34:1AAA
Destructive4.07:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.006 114.173);
  --foreground: oklch(0.183 0.028 116.628);
  --muted: oklch(0.895 0.017 84.588);
  --muted-foreground: oklch(0.511 0.015 84.593);
  --popover: oklch(0.989 0.006 114.173);
  --popover-foreground: oklch(0.183 0.028 116.628);
  --card: oklch(0.984 0.009 114.227);
  --card-foreground: oklch(0.166 0.024 116.091);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.846 0.047 115.092);
  --primary-foreground: oklch(0.302 0.035 116.256);
  --secondary: oklch(0.827 0.034 84.583);
  --secondary-foreground: oklch(0.287 0.026 84.3);
  --accent: oklch(0.833 0.053 135.158);
  --accent-foreground: oklch(0.292 0.041 135.637);
  --destructive: oklch(0.434 0.172 28.511);
  --destructive-foreground: oklch(0.914 0.04 17.909);
  --ring: oklch(0.846 0.047 115.092);
  --chart-1: oklch(0.846 0.047 115.092);
  --chart-2: oklch(0.827 0.034 84.583);
  --chart-3: oklch(0.833 0.053 135.158);
  --chart-4: oklch(0.848 0.03 84.59);
  --chart-5: oklch(0.85 0.052 115.196);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.13 0.018 114.874);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.284 0.022 84.412);
  --muted-foreground: oklch(0.7 0.014 84.59);
  --popover: oklch(0.13 0.018 114.874);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.149 0.021 115.239);
  --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.846 0.047 115.092);
  --primary-foreground: oklch(0.302 0.035 116.256);
  --secondary: oklch(0.827 0.034 84.583);
  --secondary-foreground: oklch(0.287 0.026 84.3);
  --accent: oklch(0.833 0.053 135.158);
  --accent-foreground: oklch(0.292 0.041 135.637);
  --destructive: oklch(0.62 0.23 27.236);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.846 0.047 115.092);
  --chart-1: oklch(0.846 0.047 115.092);
  --chart-2: oklch(0.827 0.034 84.583);
  --chart-3: oklch(0.833 0.053 135.158);
  --chart-4: oklch(0.848 0.03 84.59);
  --chart-5: oklch(0.85 0.052 115.196);
}