Cobalt Next for shadcn/ui

Cobalt Next is a shadcn/ui theme built around a muted light blue primary color (#d8dee9) with blue accents (#345365). The light mode uses a blue-tinted background (#1a2a32). Dark mode keeps the muted light blue primary (#d8dee9) on a blue-tinted background (#1a2a32).

Color palette

TokenLightDark
Background
#1a2a32darkslategray
#1a2a32darkslategray
Foreground
#ffffffwhite
#ffffffwhite
Card
#17242cdarkslategray
#17242cdarkslategray
Card foreground
#ffffffwhite
#ffffffwhite
Popover
#152128black
#152128black
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#d8dee9gainsboro
#d8dee9gainsboro
Primary foreground
#33415bdarkslategray
#33415bdarkslategray
Secondary
#343c4bdarkslategray
#343c4bdarkslategray
Secondary foreground
#d2d7e0gainsboro
#d2d7e0gainsboro
Muted
#2b3236darkslategray
#2b3236darkslategray
Muted foreground
#a6b2b9darkgray
#a6b2b9darkgray
Accent
#345365darkslategray
#345365darkslategray
Accent foreground
#dde8eelavender
#dde8eelavender
Destructive
#e91c01red
#e91c01red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#28363edarkslategray
#28363edarkslategray
Input
#2e3e48darkslategray
#2e3e48darkslategray
Ring
#d8dee9gainsboro
#d8dee9gainsboro

Contrast

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

Light mode
Text on background14.83:1AAA
Text on card15.86:1AAA
Primary button7.57:1AAA
Secondary button7.64:1AAA
Muted text6.01:1AA
Accent6.55:1AA
Destructive4.51:1AA
Dark mode
Text on background14.83:1AAA
Text on card15.86:1AAA
Primary button7.57:1AAA
Secondary button7.64:1AAA
Muted text6.01:1AA
Accent6.55:1AA
Destructive4.51:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.273 0.027 234.461);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.312 0.013 233.21);
  --muted-foreground: oklch(0.758 0.017 232.903);
  --popover: oklch(0.241 0.022 234.311);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.252 0.024 234.366);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.324 0.024 233.864);
  --input: oklch(0.354 0.027 233.909);
  --primary: oklch(0.899 0.017 263.013);
  --primary-foreground: oklch(0.376 0.048 262.419);
  --secondary: oklch(0.356 0.028 262.736);
  --secondary-foreground: oklch(0.877 0.013 263.022);
  --accent: oklch(0.426 0.047 234.854);
  --accent-foreground: oklch(0.924 0.014 232.793);
  --destructive: oklch(0.595 0.234 30.61);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.899 0.017 263.013);
  --chart-1: oklch(0.899 0.017 263.013);
  --chart-2: oklch(0.356 0.028 262.736);
  --chart-3: oklch(0.426 0.047 234.854);
  --chart-4: oklch(0.384 0.031 262.727);
  --chart-5: oklch(0.898 0.018 263.007);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.273 0.027 234.461);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.312 0.013 233.21);
  --muted-foreground: oklch(0.758 0.017 232.903);
  --popover: oklch(0.241 0.022 234.311);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.252 0.024 234.366);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.324 0.024 233.864);
  --input: oklch(0.354 0.027 233.909);
  --primary: oklch(0.899 0.017 263.013);
  --primary-foreground: oklch(0.376 0.048 262.419);
  --secondary: oklch(0.356 0.028 262.736);
  --secondary-foreground: oklch(0.877 0.013 263.022);
  --accent: oklch(0.426 0.047 234.854);
  --accent-foreground: oklch(0.924 0.014 232.793);
  --destructive: oklch(0.595 0.234 30.61);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.899 0.017 263.013);
  --chart-1: oklch(0.899 0.017 263.013);
  --chart-2: oklch(0.356 0.028 262.736);
  --chart-3: oklch(0.426 0.047 234.854);
  --chart-4: oklch(0.384 0.031 262.727);
  --chart-5: oklch(0.898 0.018 263.007);
}