Constant for shadcn/ui

Constant is a shadcn/ui theme built around a muted deep green primary color (#42462f) with muted light green accents (#cdd2b6). The light mode uses a neutral background (#fdfefb). Dark mode keeps the muted deep green primary (#42462f) on a neutral background (#030401).

Color palette

TokenLightDark
Background
#fdfefbwhite
#030401black
Foreground
#070901black
#ffffffwhite
Card
#fdfefbwhite
#030401black
Card foreground
#070901black
#ffffffwhite
Popover
#fdfefbwhite
#030401black
Popover foreground
#070901black
#ffffffwhite
Primary
#42462fdarkslategray
#42462fdarkslategray
Primary foreground
#d9dccblightgrey
#d9dccblightgrey
Secondary
#d8dbcclightgrey
#23251eblack
Secondary foreground
#414531darkslategray
#bfc2b3silver
Muted
#f0f1eewhitesmoke
#10110eblack
Muted foreground
#6c6f5ddimgray
#9fa290darkgray
Accent
#cdd2b6silver
#3d412fdarkslategray
Accent foreground
#323621darkslategray
#d6d8calightgrey
Destructive
#ba2808firebrick
#f64d28tomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#42462fdarkslategray
#42462fdarkslategray

Contrast

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

Light mode
Text on background19.76:1AAA
Text on card19.76:1AAA
Primary button6.98:1AA
Secondary button7.04:1AAA
Muted text4.55:1AA
Accent8.02:1AAA
Destructive6.17:1AA
Dark mode
Text on background20.56:1AAA
Text on card20.56:1AAA
Primary button6.98:1AA
Secondary button8.56:1AAA
Muted text7.27:1AAA
Accent7.26:1AAA
Destructive3.48:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.003 115.642);
  --foreground: oklch(0.134 0.025 116.289);
  --muted: oklch(0.957 0.003 115.641);
  --muted-foreground: oklch(0.534 0.028 116.546);
  --popover: oklch(0.995 0.003 115.642);
  --popover-foreground: oklch(0.134 0.025 116.289);
  --card: oklch(0.995 0.003 115.642);
  --card-foreground: oklch(0.134 0.025 116.289);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.384 0.038 117.427);
  --primary-foreground: oklch(0.888 0.024 116.065);
  --secondary: oklch(0.885 0.02 115.995);
  --secondary-foreground: oklch(0.379 0.033 117.179);
  --accent: oklch(0.853 0.038 116.406);
  --accent-foreground: oklch(0.322 0.035 117.625);
  --destructive: oklch(0.515 0.186 32.903);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.384 0.038 117.427);
  --chart-1: oklch(0.384 0.038 117.427);
  --chart-2: oklch(0.885 0.02 115.995);
  --chart-3: oklch(0.853 0.038 116.406);
  --chart-4: oklch(0.906 0.016 115.912);
  --chart-5: oklch(0.389 0.043 117.667);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.013 116.067);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.174 0.005 116.106);
  --muted-foreground: oklch(0.705 0.026 116.265);
  --popover: oklch(0.101 0.013 116.067);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.101 0.013 116.067);
  --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.384 0.038 117.427);
  --primary-foreground: oklch(0.888 0.024 116.065);
  --secondary: oklch(0.26 0.013 116.526);
  --secondary-foreground: oklch(0.807 0.021 116.058);
  --accent: oklch(0.367 0.03 117.083);
  --accent-foreground: oklch(0.877 0.02 115.998);
  --destructive: oklch(0.655 0.211 33.881);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.384 0.038 117.427);
  --chart-1: oklch(0.384 0.038 117.427);
  --chart-2: oklch(0.26 0.013 116.526);
  --chart-3: oklch(0.367 0.03 117.083);
  --chart-4: oklch(0.293 0.016 116.578);
  --chart-5: oklch(0.389 0.043 117.667);
}