Environment for shadcn/ui

Environment is a shadcn/ui theme built around a near-white primary color (#fafbf9) with near-white accents (#f9fbf9). The light mode uses a neutral background (#f9fcf8). Dark mode keeps the near-white primary (#fafbf9) on a neutral background (#020402).

Color palette

TokenLightDark
Background
#f9fcf8mintcream
#020402black
Foreground
#071202black
#f6faf5whitesmoke
Card
#f9fcf8mintcream
#020402black
Card foreground
#071202black
#f6faf5whitesmoke
Popover
#f9fcf8mintcream
#020402black
Popover foreground
#071202black
#f6faf5whitesmoke
Primary
#fafbf9snow
#fafbf9snow
Primary foreground
#2c3427darkslategray
#2c3427darkslategray
Secondary
#fafbf9snow
#fafbf9snow
Secondary foreground
#323427darkslategray
#323427darkslategray
Muted
#e6ebd1antiquewhite
#292e14black
Muted foreground
#474841darkslategray
#bcbeb7silver
Accent
#f9fbf9mintcream
#f9fbf9mintcream
Accent foreground
#27342adarkslategray
#27342adarkslategray
Destructive
#7a210bmaroon
#ec4f27chocolate
Destructive foreground
#f9c9bdpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fafbf9snow
#fafbf9snow

Contrast

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

Light mode
Text on background18.50:1AAA
Text on card18.50:1AAA
Primary button12.39:1AAA
Secondary button12.19:1AAA
Muted text7.54:1AAA
Accent12.51:1AAA
Destructive6.89:1AA
Dark mode
Text on background19.54:1AAA
Text on card19.54:1AAA
Primary button12.39:1AAA
Secondary button12.19:1AAA
Muted text7.46:1AAA
Accent12.51:1AAA
Destructive3.67:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.987 0.006 135.452);
  --foreground: oklch(0.166 0.039 134.369);
  --muted: oklch(0.929 0.035 115.511);
  --muted-foreground: oklch(0.399 0.011 115.351);
  --popover: oklch(0.987 0.006 135.452);
  --popover-foreground: oklch(0.166 0.039 134.369);
  --card: oklch(0.987 0.006 135.452);
  --card-foreground: oklch(0.166 0.039 134.369);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.986 0.002 135.437);
  --primary-foreground: oklch(0.314 0.025 135.801);
  --secondary: oklch(0.986 0.002 114.859);
  --secondary-foreground: oklch(0.32 0.022 116.108);
  --accent: oklch(0.986 0.002 151.376);
  --accent-foreground: oklch(0.311 0.025 150.166);
  --destructive: oklch(0.389 0.127 34.487);
  --destructive-foreground: oklch(0.876 0.057 34.379);
  --ring: oklch(0.986 0.002 135.437);
  --chart-1: oklch(0.986 0.002 135.437);
  --chart-2: oklch(0.986 0.002 114.859);
  --chart-3: oklch(0.986 0.002 151.376);
  --chart-4: oklch(1.007 0.001 294.806);
  --chart-5: oklch(0.986 0.003 135.439);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.097 0.012 134.284);
  --foreground: oklch(0.981 0.008 135.464);
  --muted: oklch(0.29 0.043 117.714);
  --muted-foreground: oklch(0.797 0.01 115.047);
  --popover: oklch(0.097 0.012 134.284);
  --popover-foreground: oklch(0.981 0.008 135.464);
  --card: oklch(0.097 0.012 134.284);
  --card-foreground: oklch(0.981 0.008 135.464);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.986 0.002 135.437);
  --primary-foreground: oklch(0.314 0.025 135.801);
  --secondary: oklch(0.986 0.002 114.859);
  --secondary-foreground: oklch(0.32 0.022 116.108);
  --accent: oklch(0.986 0.002 151.376);
  --accent-foreground: oklch(0.311 0.025 150.166);
  --destructive: oklch(0.64 0.201 34.767);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.986 0.002 135.437);
  --chart-1: oklch(0.986 0.002 135.437);
  --chart-2: oklch(0.986 0.002 114.859);
  --chart-3: oklch(0.986 0.002 151.376);
  --chart-4: oklch(1.007 0.001 294.806);
  --chart-5: oklch(0.986 0.003 135.439);
}