Consistency for shadcn/ui

Consistency is a shadcn/ui theme built around a vivid light blue primary color (#c8d3fe) with muted light blue accents (#d7d9e0). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid light blue primary (#c8d3fe) on a blue-tinted background (#050710).

Color palette

TokenLightDark
Background
#ffffffwhite
#050710black
Foreground
#020308black
#ffffffwhite
Card
#ffffffwhite
#050710black
Card foreground
#020308black
#ffffffwhite
Popover
#ffffffwhite
#050710black
Popover foreground
#020308black
#ffffffwhite
Primary
#c8d3felavender
#c8d3felavender
Primary foreground
#021f92darkblue
#021f92darkblue
Secondary
#d7d9e0gainsboro
#23252fdarkslategray
Secondary foreground
#3a3e4adarkslategray
#b9bccbsilver
Muted
#d3d7e3gainsboro
#1c1f2cblack
Muted foreground
#606062dimgray
#9d9e9fdarkgray
Accent
#d7d9e0gainsboro
#23252fdarkslategray
Accent foreground
#3a3e4adarkslategray
#b9bccbsilver
Destructive
#7a0705maroon
#f00e0ared
Destructive foreground
#fcb7b6lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c8d3felavender
#c8d3felavender

Contrast

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

Light mode
Text on background20.60:1AAA
Text on card20.60:1AAA
Primary button8.77:1AAA
Secondary button7.55:1AAA
Muted text4.35:1AA Large
Accent7.55:1AAA
Destructive6.74:1AA
Dark mode
Text on background20.11:1AAA
Text on card20.11:1AAA
Primary button8.77:1AAA
Secondary button8.07:1AAA
Muted text6.11:1AA
Accent8.07:1AAA
Destructive4.40:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.101 0.018 267.159);
  --muted: oklch(0.879 0.018 274.783);
  --muted-foreground: oklch(0.49 0.002 274.972);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.101 0.018 267.159);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.101 0.018 267.159);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.872 0.062 274.053);
  --primary-foreground: oklch(0.329 0.186 264.303);
  --secondary: oklch(0.885 0.01 274.901);
  --secondary-foreground: oklch(0.364 0.022 274.195);
  --accent: oklch(0.885 0.01 274.901);
  --accent-foreground: oklch(0.364 0.022 274.195);
  --destructive: oklch(0.369 0.146 28.921);
  --destructive-foreground: oklch(0.842 0.081 20.006);
  --ring: oklch(0.872 0.062 274.053);
  --chart-1: oklch(0.872 0.062 274.053);
  --chart-2: oklch(0.885 0.01 274.901);
  --chart-3: oklch(0.885 0.01 274.901);
  --chart-4: oklch(0.91 0.007 274.934);
  --chart-5: oklch(0.87 0.063 274.017);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.131 0.02 269.579);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.242 0.025 273.555);
  --muted-foreground: oklch(0.698 0.002 274.994);
  --popover: oklch(0.131 0.02 269.579);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.131 0.02 269.579);
  --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.872 0.062 274.053);
  --primary-foreground: oklch(0.329 0.186 264.303);
  --secondary: oklch(0.267 0.019 274.067);
  --secondary-foreground: oklch(0.798 0.021 274.697);
  --accent: oklch(0.267 0.019 274.067);
  --accent-foreground: oklch(0.798 0.021 274.697);
  --destructive: oklch(0.603 0.243 29.102);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.872 0.062 274.053);
  --chart-1: oklch(0.872 0.062 274.053);
  --chart-2: oklch(0.267 0.019 274.067);
  --chart-3: oklch(0.267 0.019 274.067);
  --chart-4: oklch(0.296 0.022 274.018);
  --chart-5: oklch(0.87 0.063 274.017);
}