Phase for shadcn/ui

Phase is a shadcn/ui theme built around a deep violet primary color (#371b4b) with near-white accents (#e8e8e8). The light mode uses a neutral background (#faf6fd). Dark mode keeps the deep violet primary (#371b4b) on a neutral background (#030203).

Color palette

TokenLightDark
Background
#faf6fdghostwhite
#030203black
Foreground
#000000black
#fdfcfdwhite
Card
#faf6fdghostwhite
#030203black
Card foreground
#000000black
#fdfcfdwhite
Popover
#faf6fdghostwhite
#030203black
Popover foreground
#000000black
#fdfcfdwhite
Primary
#371b4bmidnightblue
#371b4bmidnightblue
Primary foreground
#d0b4e4thistle
#d0b4e4thistle
Secondary
#e8e8e8lavender
#27232adarkslategray
Secondary foreground
#4f4f4fdarkslategray
#c0bac5silver
Muted
#f1dfdfmistyrose
#180e20black
Muted foreground
#4c3838darkslategray
#beb3c7silver
Accent
#e8e8e8lavender
#27232adarkslategray
Accent foreground
#4f4f4fdarkslategray
#c0bac5silver
Destructive
#c62c06firebrick
#f8542atomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#371b4bmidnightblue
#371b4bmidnightblue

Contrast

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

Light mode
Text on background19.74:1AAA
Text on card19.74:1AAA
Primary button7.98:1AAA
Secondary button6.68:1AA
Muted text8.49:1AAA
Accent6.68:1AA
Destructive5.57:1AA
Dark mode
Text on background20.26:1AAA
Text on card20.26:1AAA
Primary button7.98:1AAA
Secondary button8.16:1AAA
Muted text9.30:1AAA
Accent8.16:1AAA
Destructive6.29:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.01 311.642);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.919 0.019 17.507);
  --muted-foreground: oklch(0.364 0.028 18.545);
  --popover: oklch(0.98 0.01 311.642);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.98 0.01 311.642);
  --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.286 0.09 308.695);
  --primary-foreground: oklch(0.809 0.074 310.984);
  --secondary: oklch(0.931 0 180);
  --secondary-foreground: oklch(0.428 0 180);
  --accent: oklch(0.931 0 180);
  --accent-foreground: oklch(0.428 0 180);
  --destructive: oklch(0.54 0.194 33.328);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.286 0.09 308.695);
  --chart-1: oklch(0.286 0.09 308.695);
  --chart-2: oklch(0.931 0 180);
  --chart-3: oklch(0.931 0 180);
  --chart-4: oklch(0.954 0 180);
  --chart-5: oklch(0.285 0.095 308.433);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.086 0.01 312.691);
  --foreground: oklch(0.991 0.002 311.706);
  --muted: oklch(0.188 0.037 310.042);
  --muted-foreground: oklch(0.782 0.031 311.41);
  --popover: oklch(0.086 0.01 312.691);
  --popover-foreground: oklch(0.991 0.002 311.706);
  --card: oklch(0.086 0.01 312.691);
  --card-foreground: oklch(0.991 0.002 311.706);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.286 0.09 308.695);
  --primary-foreground: oklch(0.809 0.074 310.984);
  --secondary: oklch(0.263 0.014 311.299);
  --secondary-foreground: oklch(0.796 0.018 311.547);
  --accent: oklch(0.263 0.014 311.299);
  --accent-foreground: oklch(0.796 0.018 311.547);
  --destructive: oklch(0.665 0.208 34.782);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.286 0.09 308.695);
  --chart-1: oklch(0.286 0.09 308.695);
  --chart-2: oklch(0.263 0.014 311.299);
  --chart-3: oklch(0.263 0.014 311.299);
  --chart-4: oklch(0.293 0.016 311.279);
  --chart-5: oklch(0.285 0.095 308.433);
}