Slate for shadcn/ui

Slate is a shadcn/ui theme built around a deep violet primary color (#2b153d) with neutral gray accents (#dbdbdb). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep violet primary (#2b153d) on a neutral background (#050307).

Color palette

TokenLightDark
Background
#ffffffwhite
#050307black
Foreground
#0d0614black
#faf9fbghostwhite
Card
#ffffffwhite
#050307black
Card foreground
#0d0614black
#faf9fbghostwhite
Popover
#ffffffwhite
#050307black
Popover foreground
#0d0614black
#faf9fbghostwhite
Primary
#2b153dmidnightblue
#2b153dmidnightblue
Primary foreground
#c5a4e0plum
#c5a4e0plum
Secondary
#dbdbdbgainsboro
#211f23black
Secondary foreground
#424242darkslategray
#bbb5bfsilver
Muted
#e3dedegainsboro
#1f1c21black
Muted foreground
#504949darkslategray
#b3afb6darkgray
Accent
#dbdbdbgainsboro
#211f23black
Accent foreground
#424242darkslategray
#bbb5bfsilver
Destructive
#740902maroon
#f11404red
Destructive foreground
#feafaalightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#2b153dmidnightblue
#2b153dmidnightblue

Contrast

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

Light mode
Text on background19.93:1AAA
Text on card19.93:1AAA
Primary button7.65:1AAA
Secondary button7.27:1AAA
Muted text6.60:1AA
Accent7.27:1AAA
Destructive6.70:1AA
Dark mode
Text on background19.57:1AAA
Text on card19.57:1AAA
Primary button7.65:1AAA
Secondary button8.15:1AAA
Muted text7.78:1AAA
Accent8.15:1AAA
Destructive4.33:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.142 0.033 309.102);
  --muted: oklch(0.905 0.005 17.243);
  --muted-foreground: oklch(0.413 0.008 17.49);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.142 0.033 309.102);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.142 0.033 309.102);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.248 0.076 307.117);
  --primary-foreground: oklch(0.768 0.091 309.328);
  --secondary: oklch(0.892 0 180);
  --secondary-foreground: oklch(0.38 0 180);
  --accent: oklch(0.892 0 180);
  --accent-foreground: oklch(0.38 0 180);
  --destructive: oklch(0.355 0.139 30.333);
  --destructive-foreground: oklch(0.828 0.093 23.805);
  --ring: oklch(0.248 0.076 307.117);
  --chart-1: oklch(0.248 0.076 307.117);
  --chart-2: oklch(0.892 0 180);
  --chart-3: oklch(0.892 0 180);
  --chart-4: oklch(0.916 0 180);
  --chart-5: oklch(0.247 0.08 306.842);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.106 0.018 311.784);
  --foreground: oklch(0.984 0.002 310.416);
  --muted: oklch(0.233 0.009 310.086);
  --muted-foreground: oklch(0.76 0.009 310.323);
  --popover: oklch(0.106 0.018 311.784);
  --popover-foreground: oklch(0.984 0.002 310.416);
  --card: oklch(0.106 0.018 311.784);
  --card-foreground: oklch(0.984 0.002 310.416);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.248 0.076 307.117);
  --primary-foreground: oklch(0.768 0.091 309.328);
  --secondary: oklch(0.243 0.009 310.077);
  --secondary-foreground: oklch(0.781 0.015 310.263);
  --accent: oklch(0.243 0.009 310.077);
  --accent-foreground: oklch(0.781 0.015 310.263);
  --destructive: oklch(0.606 0.243 29.775);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.248 0.076 307.117);
  --chart-1: oklch(0.248 0.076 307.117);
  --chart-2: oklch(0.243 0.009 310.077);
  --chart-3: oklch(0.243 0.009 310.077);
  --chart-4: oklch(0.274 0.011 310.055);
  --chart-5: oklch(0.247 0.08 306.842);
}