Consensus for shadcn/ui

Consensus is a shadcn/ui theme built around a neutral gray primary color (#939593) with neutral gray accents (#959395). The light mode uses a neutral background (#fbfefb). Dark mode keeps the neutral gray primary (#939593) on a green-tinted background (#061005).

Color palette

TokenLightDark
Background
#fbfefbwhite
#061005black
Foreground
#041202black
#f7f8f6whitesmoke
Card
#f7fdf6mintcream
#081306black
Card foreground
#030e02black
#f9fbf9mintcream
Popover
#f7fdf6mintcream
#081306black
Popover foreground
#030e02black
#f9fbf9mintcream
Primary
#939593lightslategray
#939593lightslategray
Primary foreground
#000000black
#000000black
Secondary
#959395lightslategray
#959395lightslategray
Secondary foreground
#000000black
#000000black
Muted
#f2ecf3whitesmoke
#120c13black
Muted foreground
#5f5760dimgray
#a79fa8darkgray
Accent
#959395lightslategray
#959395lightslategray
Accent foreground
#000000black
#000000black
Destructive
#ad1801firebrick
#ef2101red
Destructive foreground
#ffe5e1mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#939593lightslategray
#939593lightslategray

Contrast

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

Light mode
Text on background18.94:1AAA
Text on card19.11:1AAA
Primary button6.95:1AA
Secondary button6.86:1AA
Muted text6.00:1AA
Accent6.86:1AA
Destructive6.06:1AA
Dark mode
Text on background18.23:1AAA
Text on card18.22:1AAA
Primary button6.95:1AA
Secondary button6.86:1AA
Muted text7.51:1AAA
Accent6.86:1AA
Destructive4.31:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.006 142.093);
  --foreground: oklch(0.163 0.042 140.038);
  --muted: oklch(0.951 0.01 322.15);
  --muted-foreground: oklch(0.468 0.018 322.241);
  --popover: oklch(0.989 0.011 142.073);
  --popover-foreground: oklch(0.145 0.037 139.791);
  --card: oklch(0.989 0.011 142.073);
  --card-foreground: oklch(0.145 0.037 139.791);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.668 0.004 142.093);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.665 0.004 322.132);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.665 0.004 322.132);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.478 0.184 31.316);
  --destructive-foreground: oklch(0.941 0.029 28.122);
  --ring: oklch(0.668 0.004 142.093);
  --chart-1: oklch(0.668 0.004 142.093);
  --chart-2: oklch(0.665 0.004 322.132);
  --chart-3: oklch(0.665 0.004 322.132);
  --chart-4: oklch(0.69 0.004 322.13);
  --chart-5: oklch(0.672 0.015 142.035);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.157 0.028 140.732);
  --foreground: oklch(0.978 0.003 142.102);
  --muted: oklch(0.165 0.016 322.428);
  --muted-foreground: oklch(0.711 0.016 322.189);
  --popover: oklch(0.172 0.032 140.978);
  --popover-foreground: oklch(0.985 0.002 142.106);
  --card: oklch(0.172 0.032 140.978);
  --card-foreground: oklch(0.985 0.002 142.106);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.668 0.004 142.093);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.665 0.004 322.132);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.665 0.004 322.132);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.606 0.236 30.934);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.668 0.004 142.093);
  --chart-1: oklch(0.668 0.004 142.093);
  --chart-2: oklch(0.665 0.004 322.132);
  --chart-3: oklch(0.665 0.004 322.132);
  --chart-4: oklch(0.69 0.004 322.13);
  --chart-5: oklch(0.672 0.015 142.035);
}