Gray for shadcn/ui

Gray is a shadcn/ui theme built around a muted deep violet primary color (#473951) with muted deep purple accents (#51394f). The light mode uses a neutral background (#faf8fc). Dark mode keeps the muted deep violet primary (#473951) on a neutral background (#030204).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#030204black
Foreground
#000000black
#ffffffwhite
Card
#f8f4fbghostwhite
#050307black
Card foreground
#000000black
#ffffffwhite
Popover
#faf8fcghostwhite
#030204black
Popover foreground
#000000black
#ffffffwhite
Primary
#473951darkslategray
#473951darkslategray
Primary foreground
#dfd8e3gainsboro
#dfd8e3gainsboro
Secondary
#3b3951darkslategray
#3b3951darkslategray
Secondary foreground
#d9d8e3gainsboro
#d9d8e3gainsboro
Muted
#d5d4ddlightgrey
#22222bdarkslategray
Muted foreground
#5a586adimgray
#9795a7darkgray
Accent
#51394fdarkslategray
#51394fdarkslategray
Accent foreground
#e3d8e3gainsboro
#e3d8e3gainsboro
Destructive
#c11c06firebrick
#f94f39tomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#473951darkslategray
#473951darkslategray

Contrast

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

Light mode
Text on background19.87:1AAA
Text on card19.33:1AAA
Primary button7.64:1AAA
Secondary button7.86:1AAA
Muted text4.70:1AA
Accent7.42:1AAA
Destructive6.11:1AA
Dark mode
Text on background20.75:1AAA
Text on card20.51:1AAA
Primary button7.64:1AAA
Secondary button7.86:1AAA
Muted text5.39:1AA
Accent7.42:1AAA
Destructive6.21:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.006 311.673);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.874 0.013 289.976);
  --muted-foreground: oklch(0.469 0.028 289.092);
  --popover: oklch(0.982 0.006 311.673);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.972 0.009 311.647);
  --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.369 0.043 310.779);
  --primary-foreground: oklch(0.891 0.017 311.573);
  --secondary: oklch(0.357 0.04 287.994);
  --secondary-foreground: oklch(0.887 0.015 289.919);
  --accent: oklch(0.38 0.047 329.289);
  --accent-foreground: oklch(0.895 0.018 328.278);
  --destructive: oklch(0.519 0.199 30.804);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.369 0.043 310.779);
  --chart-1: oklch(0.369 0.043 310.779);
  --chart-2: oklch(0.357 0.04 287.994);
  --chart-3: oklch(0.38 0.047 329.289);
  --chart-4: oklch(0.383 0.044 287.948);
  --chart-5: oklch(0.366 0.051 310.595);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.012 312.891);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.255 0.017 288.941);
  --muted-foreground: oklch(0.678 0.025 289.529);
  --popover: oklch(0.085 0.012 312.891);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.108 0.015 312.891);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.369 0.043 310.779);
  --primary-foreground: oklch(0.891 0.017 311.573);
  --secondary: oklch(0.357 0.04 287.994);
  --secondary-foreground: oklch(0.887 0.015 289.919);
  --accent: oklch(0.38 0.047 329.289);
  --accent-foreground: oklch(0.895 0.018 328.278);
  --destructive: oklch(0.663 0.209 30.743);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.369 0.043 310.779);
  --chart-1: oklch(0.369 0.043 310.779);
  --chart-2: oklch(0.357 0.04 287.994);
  --chart-3: oklch(0.38 0.047 329.289);
  --chart-4: oklch(0.383 0.044 287.948);
  --chart-5: oklch(0.366 0.051 310.595);
}