Preserves for shadcn/ui

Preserves is a shadcn/ui theme built around a light blue primary color (#c6d4e7) with light indigo accents (#c8c6e7). The light mode uses a neutral background (#f8fafc). Dark mode keeps the light blue primary (#c6d4e7) on a blue-tinted background (#04070b).

Color palette

TokenLightDark
Background
#f8fafcghostwhite
#04070bblack
Foreground
#040c16black
#fcfcfdwhite
Card
#f8fafcghostwhite
#04070bblack
Card foreground
#040c16black
#fcfcfdwhite
Popover
#f8fafcghostwhite
#04070bblack
Popover foreground
#040c16black
#fcfcfdwhite
Primary
#c6d4e7lightgrey
#c6d4e7lightgrey
Primary foreground
#253a56darkslategray
#253a56darkslategray
Secondary
#c6e4e7powderblue
#c6e4e7powderblue
Secondary foreground
#255256darkslategray
#255256darkslategray
Muted
#d3e7e8gainsboro
#172a2cdarkslategray
Muted foreground
#4e5556darkslategray
#a9b1b1darkgray
Accent
#c8c6e7thistle
#c8c6e7thistle
Accent foreground
#282556midnightblue
#282556midnightblue
Destructive
#960d0ddarkred
#ee3f3ftomato
Destructive foreground
#fcd9d9mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c6d4e7lightgrey
#c6d4e7lightgrey

Contrast

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

Light mode
Text on background18.73:1AAA
Text on card18.73:1AAA
Primary button7.68:1AAA
Secondary button6.48:1AA
Muted text5.94:1AA
Accent8.50:1AAA
Destructive6.79:1AA
Dark mode
Text on background19.66:1AAA
Text on card19.66:1AAA
Primary button7.68:1AAA
Secondary button6.48:1AA
Muted text6.82:1AA
Accent8.50:1AAA
Destructive3.87:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.003 254.971);
  --foreground: oklch(0.149 0.027 251.14);
  --muted: oklch(0.914 0.021 201.979);
  --muted-foreground: oklch(0.443 0.01 201.99);
  --popover: oklch(0.983 0.003 254.971);
  --popover-foreground: oklch(0.149 0.027 251.14);
  --card: oklch(0.983 0.003 254.971);
  --card-foreground: oklch(0.149 0.027 251.14);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.865 0.03 255.113);
  --primary-foreground: oklch(0.344 0.056 255.54);
  --secondary: oklch(0.898 0.032 201.867);
  --secondary-foreground: oklch(0.41 0.05 201.623);
  --accent: oklch(0.838 0.045 288.438);
  --accent-foreground: oklch(0.296 0.086 282.818);
  --destructive: oklch(0.429 0.168 28.227);
  --destructive-foreground: oklch(0.915 0.038 17.872);
  --ring: oklch(0.865 0.03 255.113);
  --chart-1: oklch(0.865 0.03 255.113);
  --chart-2: oklch(0.898 0.032 201.867);
  --chart-3: oklch(0.838 0.045 288.438);
  --chart-4: oklch(0.917 0.026 201.929);
  --chart-5: oklch(0.864 0.032 255.123);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.128 0.011 248.928);
  --foreground: oklch(0.992 0.001 254.956);
  --muted: oklch(0.27 0.026 201.558);
  --muted-foreground: oklch(0.754 0.009 202.094);
  --popover: oklch(0.128 0.011 248.928);
  --popover-foreground: oklch(0.992 0.001 254.956);
  --card: oklch(0.128 0.011 248.928);
  --card-foreground: oklch(0.992 0.001 254.956);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.865 0.03 255.113);
  --primary-foreground: oklch(0.344 0.056 255.54);
  --secondary: oklch(0.898 0.032 201.867);
  --secondary-foreground: oklch(0.41 0.05 201.623);
  --accent: oklch(0.838 0.045 288.438);
  --accent-foreground: oklch(0.296 0.086 282.818);
  --destructive: oklch(0.63 0.212 25.749);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.865 0.03 255.113);
  --chart-1: oklch(0.865 0.03 255.113);
  --chart-2: oklch(0.898 0.032 201.867);
  --chart-3: oklch(0.838 0.045 288.438);
  --chart-4: oklch(0.917 0.026 201.929);
  --chart-5: oklch(0.864 0.032 255.123);
}