2 for shadcn/ui

2 is a shadcn/ui theme built around a blue primary color (#1a5ca8) with indigo accents (#1f1aa8). The light mode uses a neutral background (#f6fafd). Dark mode keeps the blue primary (#1a5ca8) on a blue-tinted background (#04070c).

Color palette

TokenLightDark
Background
#f6fafdghostwhite
#04070cblack
Foreground
#020a12black
#f8fafbghostwhite
Card
#f6fafdghostwhite
#04070cblack
Card foreground
#020a12black
#f8fafbghostwhite
Popover
#f6fafdghostwhite
#04070cblack
Popover foreground
#020a12black
#f8fafbghostwhite
Primary
#1a5ca8steelblue
#1a5ca8steelblue
Primary foreground
#f6fafeghostwhite
#f6fafeghostwhite
Secondary
#1aa3a8lightseagreen
#1aa3a8lightseagreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#cde8e9gainsboro
#163132darkslategray
Muted foreground
#3e4646darkslategray
#b9c0c1silver
Accent
#1f1aa8darkblue
#1f1aa8darkblue
Accent foreground
#f6f6feghostwhite
#f6f6feghostwhite
Destructive
#5d1309maroon
#eb3f28orangered
Destructive foreground
#f6aca2lightpink
#ffffffwhite
Border
#e8e8e9lavender
#252627darkslategray
Input
#e8e8e9lavender
#252627darkslategray
Ring
#1a5ca8steelblue
#1a5ca8steelblue

Contrast

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

Light mode
Text on background18.95:1AAA
Text on card18.95:1AAA
Primary button6.36:1AA
Secondary button3.07:1AA Large
Muted text7.54:1AAA
Accent11.03:1AAA
Destructive7.25:1AAA
Dark mode
Text on background19.24:1AAA
Text on card19.24:1AAA
Primary button6.36:1AA
Secondary button3.07:1AA Large
Muted text7.51:1AAA
Accent11.03:1AAA
Destructive3.97:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.006 251.5);
  --foreground: oklch(0.138 0.025 244.561);
  --muted: oklch(0.913 0.028 199.201);
  --muted-foreground: oklch(0.387 0.01 199.263);
  --popover: oklch(0.983 0.006 251.5);
  --popover-foreground: oklch(0.138 0.025 244.561);
  --card: oklch(0.983 0.006 251.5);
  --card-foreground: oklch(0.138 0.025 244.561);
  --border: oklch(0.931 0.001 251.457);
  --input: oklch(0.931 0.001 251.457);
  --primary: oklch(0.477 0.137 254.959);
  --primary-foreground: oklch(0.983 0.006 251.504);
  --secondary: oklch(0.651 0.106 198.656);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.36 0.209 270.343);
  --accent-foreground: oklch(0.976 0.01 287.752);
  --destructive: oklch(0.317 0.109 31.023);
  --destructive-foreground: oklch(0.812 0.09 27.564);
  --ring: oklch(0.477 0.137 254.959);
  --chart-1: oklch(0.477 0.137 254.959);
  --chart-2: oklch(0.651 0.106 198.656);
  --chart-3: oklch(0.36 0.209 270.343);
  --chart-4: oklch(0.689 0.113 198.667);
  --chart-5: oklch(0.478 0.142 255.237);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.128 0.013 244.491);
  --foreground: oklch(0.984 0.003 251.473);
  --muted: oklch(0.291 0.033 198.434);
  --muted-foreground: oklch(0.803 0.009 199.462);
  --popover: oklch(0.128 0.013 244.491);
  --popover-foreground: oklch(0.984 0.003 251.473);
  --card: oklch(0.128 0.013 244.491);
  --card-foreground: oklch(0.984 0.003 251.473);
  --border: oklch(0.269 0.002 251.506);
  --input: oklch(0.269 0.002 251.506);
  --primary: oklch(0.477 0.137 254.959);
  --primary-foreground: oklch(0.983 0.006 251.504);
  --secondary: oklch(0.651 0.106 198.656);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.36 0.209 270.343);
  --accent-foreground: oklch(0.976 0.01 287.752);
  --destructive: oklch(0.623 0.212 30.981);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.477 0.137 254.959);
  --chart-1: oklch(0.477 0.137 254.959);
  --chart-2: oklch(0.651 0.106 198.656);
  --chart-3: oklch(0.36 0.209 270.343);
  --chart-4: oklch(0.689 0.113 198.667);
  --chart-5: oklch(0.478 0.142 255.237);
}