Consensus for shadcn/ui

Consensus is a shadcn/ui theme built around a near-white primary color (#fafcff) with near-white accents (#fcfffa). The light mode uses a neutral background (#fbfcfe). Dark mode keeps the near-white primary (#fafcff) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fbfcfewhite
#000000black
Foreground
#020508black
#f6f7f9whitesmoke
Card
#fbfcfewhite
#000000black
Card foreground
#020508black
#f6f7f9whitesmoke
Popover
#fbfcfewhite
#000000black
Popover foreground
#020508black
#f6f7f9whitesmoke
Primary
#fafcffghostwhite
#fafcffghostwhite
Primary foreground
#1261b5steelblue
#1261b5steelblue
Secondary
#fffafcsnow
#fffafcsnow
Secondary foreground
#b51261mediumvioletred
#b51261mediumvioletred
Muted
#eee3e8linen
#1c1117black
Muted foreground
#67515bdimgray
#ae98a3darkgray
Accent
#fcfffawhite
#fcfffawhite
Accent foreground
#2f5809darkgreen
#2f5809darkgreen
Destructive
#ca3507firebrick
#dd3a08orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fafcffghostwhite
#fafcffghostwhite

Contrast

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

Light mode
Text on background19.94:1AAA
Text on card19.94:1AAA
Primary button6.02:1AA
Secondary button6.31:1AA
Muted text5.75:1AA
Accent8.24:1AAA
Destructive5.23:1AA
Dark mode
Text on background19.59:1AAA
Text on card19.59:1AAA
Primary button6.02:1AA
Secondary button6.31:1AA
Muted text6.82:1AA
Accent8.24:1AAA
Destructive4.47: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.992 0.003 249.676);
  --foreground: oklch(0.111 0.015 240.156);
  --muted: oklch(0.925 0.014 346.412);
  --muted-foreground: oklch(0.46 0.033 347.853);
  --popover: oklch(0.992 0.003 249.676);
  --popover-foreground: oklch(0.111 0.015 240.156);
  --card: oklch(0.992 0.003 249.676);
  --card-foreground: oklch(0.111 0.015 240.156);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.991 0.004 249.684);
  --primary-foreground: oklch(0.495 0.151 254.797);
  --secondary: oklch(0.99 0.005 346.156);
  --secondary-foreground: oklch(0.507 0.197 359.887);
  --accent: oklch(0.996 0.006 129.189);
  --accent-foreground: oklch(0.415 0.114 134.253);
  --destructive: oklch(0.554 0.192 34.758);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.991 0.004 249.684);
  --chart-1: oklch(0.991 0.004 249.684);
  --chart-2: oklch(0.99 0.005 346.156);
  --chart-3: oklch(0.996 0.006 129.189);
  --chart-4: oklch(1.02 0.01 165.748);
  --chart-5: oklch(0.991 0.004 249.686);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.977 0.002 249.671);
  --muted: oklch(0.197 0.021 348.646);
  --muted-foreground: oklch(0.703 0.03 347.113);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.977 0.002 249.671);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.977 0.002 249.671);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.991 0.004 249.684);
  --primary-foreground: oklch(0.495 0.151 254.797);
  --secondary: oklch(0.99 0.005 346.156);
  --secondary-foreground: oklch(0.507 0.197 359.887);
  --accent: oklch(0.996 0.006 129.189);
  --accent-foreground: oklch(0.415 0.114 134.253);
  --destructive: oklch(0.593 0.206 34.633);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.991 0.004 249.684);
  --chart-1: oklch(0.991 0.004 249.684);
  --chart-2: oklch(0.99 0.005 346.156);
  --chart-3: oklch(0.996 0.006 129.189);
  --chart-4: oklch(1.02 0.01 165.748);
  --chart-5: oklch(0.991 0.004 249.686);
}