Regulation for shadcn/ui

Regulation is a shadcn/ui theme built around a muted light green primary color (#c3d5b3) with muted light green accents (#b3d5b5). The light mode uses a neutral background (#fafdf7). Dark mode keeps the muted light green primary (#c3d5b3) on a green-tinted background (#070c03).

Color palette

TokenLightDark
Background
#fafdf7mintcream
#070c03black
Foreground
#050902black
#ffffffwhite
Card
#fafdf7mintcream
#070c03black
Card foreground
#050902black
#ffffffwhite
Popover
#fafdf7mintcream
#070c03black
Popover foreground
#050902black
#ffffffwhite
Primary
#c3d5b3silver
#c3d5b3silver
Primary foreground
#2a381fdarkslategray
#2a381fdarkslategray
Secondary
#d4d5b3silver
#d4d5b3silver
Secondary foreground
#37381fdarkslategray
#37381fdarkslategray
Muted
#e6e6d5gainsboro
#292a19black
Muted foreground
#44453bdarkslategray
#c4c4basilver
Accent
#b3d5b5silver
#b3d5b5silver
Accent foreground
#1f3820darkslategray
#1f3820darkslategray
Destructive
#b71c01firebrick
#fe2701orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c3d5b3silver
#c3d5b3silver

Contrast

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

Light mode
Text on background19.53:1AAA
Text on card19.53:1AAA
Primary button8.02:1AAA
Secondary button8.00:1AAA
Muted text7.72:1AAA
Accent7.99:1AAA
Destructive6.61:1AA
Dark mode
Text on background19.74:1AAA
Text on card19.74:1AAA
Primary button8.02:1AAA
Secondary button8.00:1AAA
Muted text8.32:1AAA
Accent7.99:1AAA
Destructive3.82:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.009 130.523);
  --foreground: oklch(0.128 0.024 128.908);
  --muted: oklch(0.921 0.023 109.166);
  --muted-foreground: oklch(0.386 0.017 109.499);
  --popover: oklch(0.99 0.009 130.523);
  --popover-foreground: oklch(0.128 0.024 128.908);
  --card: oklch(0.99 0.009 130.523);
  --card-foreground: oklch(0.128 0.024 128.908);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.851 0.05 131.011);
  --primary-foreground: oklch(0.32 0.046 131.982);
  --secondary: oklch(0.864 0.046 109.663);
  --secondary-foreground: oklch(0.332 0.041 110.878);
  --accent: oklch(0.841 0.057 146.381);
  --accent-foreground: oklch(0.312 0.052 145.304);
  --destructive: oklch(0.5 0.191 31.655);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.851 0.05 131.011);
  --chart-1: oklch(0.851 0.05 131.011);
  --chart-2: oklch(0.864 0.046 109.663);
  --chart-3: oklch(0.841 0.057 146.381);
  --chart-4: oklch(0.882 0.04 109.523);
  --chart-5: oklch(0.854 0.055 131.069);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.145 0.024 129.306);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.278 0.03 110.601);
  --muted-foreground: oklch(0.818 0.014 109.025);
  --popover: oklch(0.145 0.024 129.306);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.145 0.024 129.306);
  --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.851 0.05 131.011);
  --primary-foreground: oklch(0.32 0.046 131.982);
  --secondary: oklch(0.864 0.046 109.663);
  --secondary-foreground: oklch(0.332 0.041 110.878);
  --accent: oklch(0.841 0.057 146.381);
  --accent-foreground: oklch(0.312 0.052 145.304);
  --destructive: oklch(0.637 0.246 31.257);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.851 0.05 131.011);
  --chart-1: oklch(0.851 0.05 131.011);
  --chart-2: oklch(0.864 0.046 109.663);
  --chart-3: oklch(0.841 0.057 146.381);
  --chart-4: oklch(0.882 0.04 109.523);
  --chart-5: oklch(0.854 0.055 131.069);
}