Preserves for shadcn/ui

Preserves is a shadcn/ui theme built around a vivid light indigo primary color (#9f8dfc) with vivid light violet accents (#d78dfc). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid light indigo primary (#9f8dfc) on a neutral background (#020104).

Color palette

TokenLightDark
Background
#ffffffwhite
#020104black
Foreground
#010104black
#f5f4fawhitesmoke
Card
#fcfcfcsnow
#030208black
Card foreground
#000000black
#f9f8fcghostwhite
Popover
#fcfcfcsnow
#030208black
Popover foreground
#000000black
#f9f8fcghostwhite
Primary
#9f8dfcmediumpurple
#9f8dfcmediumpurple
Primary foreground
#100255midnightblue
#100255midnightblue
Secondary
#8db2fclightskyblue
#8db2fclightskyblue
Secondary foreground
#021e55midnightblue
#021e55midnightblue
Muted
#d9dce3gainsboro
#1c1f26black
Muted foreground
#4e5056darkslategray
#a9acb1darkgray
Accent
#d78dfcviolet
#d78dfcviolet
Accent foreground
#390255midnightblue
#390255midnightblue
Destructive
#9e0a0adarkred
#f23636crimson
Destructive foreground
#fdddddmistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#9f8dfcmediumpurple
#9f8dfcmediumpurple

Contrast

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

Light mode
Text on background20.84:1AAA
Text on card20.54:1AAA
Primary button6.60:1AA
Secondary button7.49:1AAA
Muted text5.87:1AA
Accent6.91:1AA
Destructive6.60:1AA
Dark mode
Text on background19.02:1AAA
Text on card19.50:1AAA
Primary button6.60:1AA
Secondary button7.49:1AAA
Muted text7.20:1AAA
Accent6.91:1AA
Destructive3.92:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.075 0.019 292.283);
  --muted: oklch(0.894 0.01 264.515);
  --muted-foreground: oklch(0.432 0.01 264.468);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.706 0.159 289.323);
  --primary-foreground: oklch(0.216 0.132 274.592);
  --secondary: oklch(0.765 0.115 263.545);
  --secondary-foreground: oklch(0.256 0.105 261.376);
  --accent: oklch(0.759 0.171 313.616);
  --accent-foreground: oklch(0.268 0.132 309.637);
  --destructive: oklch(0.444 0.176 28.536);
  --destructive-foreground: oklch(0.925 0.035 17.799);
  --ring: oklch(0.706 0.159 289.323);
  --chart-1: oklch(0.706 0.159 289.323);
  --chart-2: oklch(0.765 0.115 263.545);
  --chart-3: oklch(0.759 0.171 313.616);
  --chart-4: oklch(0.795 0.099 263.763);
  --chart-5: oklch(0.703 0.164 289.124);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.078 0.015 292.703);
  --foreground: oklch(0.971 0.008 293.909);
  --muted: oklch(0.241 0.014 264.277);
  --muted-foreground: oklch(0.744 0.008 264.514);
  --popover: oklch(0.099 0.019 292.703);
  --popover-foreground: oklch(0.98 0.005 293.962);
  --card: oklch(0.099 0.019 292.703);
  --card-foreground: oklch(0.98 0.005 293.962);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.706 0.159 289.323);
  --primary-foreground: oklch(0.216 0.132 274.592);
  --secondary: oklch(0.765 0.115 263.545);
  --secondary-foreground: oklch(0.256 0.105 261.376);
  --accent: oklch(0.759 0.171 313.616);
  --accent-foreground: oklch(0.268 0.132 309.637);
  --destructive: oklch(0.629 0.224 26.543);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.706 0.159 289.323);
  --chart-1: oklch(0.706 0.159 289.323);
  --chart-2: oklch(0.765 0.115 263.545);
  --chart-3: oklch(0.759 0.171 313.616);
  --chart-4: oklch(0.795 0.099 263.763);
  --chart-5: oklch(0.703 0.164 289.124);
}