Sapphire for shadcn/ui

Sapphire is a shadcn/ui theme built around a near-white primary color (#ffffff) with muted deep blue accents (#35425a). The light mode uses a blue-tinted background (#191f2a). Dark mode keeps the near-white primary (#ffffff) on a blue-tinted background (#191f2a).

Color palette

TokenLightDark
Background
#191f2ablack
#191f2ablack
Foreground
#f0f0f0whitesmoke
#f0f0f0whitesmoke
Card
#151a23black
#151a23black
Card foreground
#fcfcfcsnow
#fcfcfcsnow
Popover
#131820black
#131820black
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#262a31darkslategray
#262a31darkslategray
Muted foreground
#a1a8b5darkgray
#a1a8b5darkgray
Accent
#35425adarkslategray
#35425adarkslategray
Accent foreground
#d8dee8gainsboro
#d8dee8gainsboro
Destructive
#e12514crimson
#e12514crimson
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#272c35darkslategray
#272c35darkslategray
Input
#2d333edarkslategray
#2d333edarkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background14.57:1AAA
Text on card17.02:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.03:1AA
Accent7.49:1AAA
Destructive4.68:1AA
Dark mode
Text on background14.57:1AAA
Text on card17.02:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.03:1AA
Accent7.49:1AAA
Destructive4.68:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.237 0.023 262.615);
  --foreground: oklch(0.954 0 180);
  --muted: oklch(0.283 0.013 262.902);
  --muted-foreground: oklch(0.73 0.021 262.981);
  --popover: oklch(0.206 0.019 262.668);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.217 0.02 262.648);
  --card-foreground: oklch(0.992 0 161.565);
  --border: oklch(0.291 0.019 262.815);
  --input: oklch(0.32 0.022 262.802);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.378 0.045 262.484);
  --accent-foreground: oklch(0.899 0.015 263.017);
  --destructive: oklch(0.585 0.222 30.087);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.378 0.045 262.484);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.237 0.023 262.615);
  --foreground: oklch(0.954 0 180);
  --muted: oklch(0.283 0.013 262.902);
  --muted-foreground: oklch(0.73 0.021 262.981);
  --popover: oklch(0.206 0.019 262.668);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.217 0.02 262.648);
  --card-foreground: oklch(0.992 0 161.565);
  --border: oklch(0.291 0.019 262.815);
  --input: oklch(0.32 0.022 262.802);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.378 0.045 262.484);
  --accent-foreground: oklch(0.899 0.015 263.017);
  --destructive: oklch(0.585 0.222 30.087);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.378 0.045 262.484);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}