Catppuccin Mocha for shadcn/ui

Catppuccin Mocha is a shadcn/ui theme built around a vivid light violet primary color (#caa6f7) with muted indigo accents (#3c3c5d). The light mode uses an indigo-tinted background (#1e1e2e). Dark mode keeps the vivid light violet primary (#caa6f7) on an indigo-tinted background (#1e1e2e).

Color palette

TokenLightDark
Background
#1e1e2edarkslategray
#1e1e2edarkslategray
Foreground
#cdd6f4gainsboro
#cdd6f4gainsboro
Card
#1a1a28black
#1a1a28black
Card foreground
#e2e7f9lavender
#e2e7f9lavender
Popover
#181825black
#181825black
Popover foreground
#f7f8fdghostwhite
#f7f8fdghostwhite
Primary
#caa6f7plum
#caa6f7plum
Primary foreground
#310963midnightblue
#310963midnightblue
Secondary
#3e2d53darkslategray
#3e2d53darkslategray
Secondary foreground
#d8cde4gainsboro
#d8cde4gainsboro
Muted
#2b2b36darkslategray
#2b2b36darkslategray
Muted foreground
#a6a6b9darkgray
#a6a6b9darkgray
Accent
#3c3c5ddarkslategray
#3c3c5ddarkslategray
Accent foreground
#e0e0ebgainsboro
#e0e0ebgainsboro
Destructive
#fb4023orangered
#fb4023orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#2d2d39darkslategray
#2d2d39darkslategray
Input
#343441darkslategray
#343441darkslategray
Ring
#caa6f7plum
#caa6f7plum

Contrast

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

Light mode
Text on background11.31:1AAA
Text on card13.90:1AAA
Primary button7.64:1AAA
Secondary button8.11:1AAA
Muted text5.86:1AA
Accent7.98:1AAA
Destructive3.59:1AA Large
Dark mode
Text on background11.31:1AAA
Text on card13.90:1AAA
Primary button7.64:1AAA
Secondary button8.11:1AAA
Muted text5.86:1AA
Accent7.98:1AAA
Destructive3.59:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.244 0.03 283.913);
  --foreground: oklch(0.878 0.043 272.094);
  --muted: oklch(0.293 0.021 285.027);
  --muted-foreground: oklch(0.733 0.027 285.71);
  --popover: oklch(0.216 0.025 284.103);
  --popover-foreground: oklch(0.98 0.007 272.584);
  --card: oklch(0.225 0.027 284.034);
  --card-foreground: oklch(0.929 0.024 272.369);
  --border: oklch(0.303 0.02 285.14);
  --input: oklch(0.331 0.023 285.098);
  --primary: oklch(0.787 0.119 304.446);
  --primary-foreground: oklch(0.277 0.139 295.596);
  --secondary: oklch(0.334 0.068 303.657);
  --secondary-foreground: oklch(0.864 0.033 305.939);
  --accent: oklch(0.372 0.055 283.423);
  --accent-foreground: oklch(0.91 0.014 286.109);
  --destructive: oklch(0.649 0.226 31.646);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.787 0.119 304.446);
  --chart-1: oklch(0.787 0.119 304.446);
  --chart-2: oklch(0.334 0.068 303.657);
  --chart-3: oklch(0.372 0.055 283.423);
  --chart-4: oklch(0.359 0.075 303.591);
  --chart-5: oklch(0.784 0.123 304.365);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.244 0.03 283.913);
  --foreground: oklch(0.878 0.043 272.094);
  --muted: oklch(0.293 0.021 285.027);
  --muted-foreground: oklch(0.733 0.027 285.71);
  --popover: oklch(0.216 0.025 284.103);
  --popover-foreground: oklch(0.98 0.007 272.584);
  --card: oklch(0.225 0.027 284.034);
  --card-foreground: oklch(0.929 0.024 272.369);
  --border: oklch(0.303 0.02 285.14);
  --input: oklch(0.331 0.023 285.098);
  --primary: oklch(0.787 0.119 304.446);
  --primary-foreground: oklch(0.277 0.139 295.596);
  --secondary: oklch(0.334 0.068 303.657);
  --secondary-foreground: oklch(0.864 0.033 305.939);
  --accent: oklch(0.372 0.055 283.423);
  --accent-foreground: oklch(0.91 0.014 286.109);
  --destructive: oklch(0.649 0.226 31.646);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.787 0.119 304.446);
  --chart-1: oklch(0.787 0.119 304.446);
  --chart-2: oklch(0.334 0.068 303.657);
  --chart-3: oklch(0.372 0.055 283.423);
  --chart-4: oklch(0.359 0.075 303.591);
  --chart-5: oklch(0.784 0.123 304.365);
}