Moth for shadcn/ui

Moth is a shadcn/ui theme built around a muted indigo primary color (#a4a0ca) with muted green accents (#c6caa0). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted indigo primary (#a4a0ca) on a neutral background (#040307).

Color palette

TokenLightDark
Background
#ffffffwhite
#040307black
Foreground
#070614black
#f6f6f8whitesmoke
Card
#ffffffwhite
#040307black
Card foreground
#070614black
#f6f6f8whitesmoke
Popover
#ffffffwhite
#040307black
Popover foreground
#070614black
#f6f6f8whitesmoke
Primary
#a4a0cadarkgray
#a4a0cadarkgray
Primary foreground
#161424black
#161424black
Secondary
#c6caa0tan
#c6caa0tan
Secondary foreground
#222414black
#222414black
Muted
#dadbd7gainsboro
#282824darkslategray
Muted foreground
#464738darkslategray
#c5c7b8silver
Accent
#c6caa0tan
#c6caa0tan
Accent foreground
#222414black
#222414black
Destructive
#c2100afirebrick
#ed140cred
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#a4a0cadarkgray
#a4a0cadarkgray

Contrast

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

Light mode
Text on background20.09:1AAA
Text on card20.09:1AAA
Primary button7.32:1AAA
Secondary button9.26:1AAA
Muted text6.79:1AA
Accent9.26:1AAA
Destructive6.23:1AA
Dark mode
Text on background19.05:1AAA
Text on card19.05:1AAA
Primary button7.32:1AAA
Secondary button9.26:1AAA
Muted text8.61:1AAA
Accent9.26:1AAA
Destructive4.44:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.133 0.031 286.969);
  --muted: oklch(0.889 0.005 111.123);
  --muted-foreground: oklch(0.393 0.025 112.183);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.133 0.031 286.969);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.133 0.031 286.969);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.725 0.06 289.4);
  --primary-foreground: oklch(0.202 0.031 287.867);
  --secondary: oklch(0.824 0.056 112.265);
  --secondary-foreground: oklch(0.253 0.028 113.031);
  --accent: oklch(0.824 0.056 112.265);
  --accent-foreground: oklch(0.253 0.028 113.031);
  --destructive: oklch(0.516 0.205 29.194);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.725 0.06 289.4);
  --chart-1: oklch(0.725 0.06 289.4);
  --chart-2: oklch(0.824 0.056 112.265);
  --chart-3: oklch(0.824 0.056 112.265);
  --chart-4: oklch(0.843 0.05 112.111);
  --chart-5: oklch(0.72 0.066 289.201);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.103 0.014 289.411);
  --foreground: oklch(0.975 0.003 290.955);
  --muted: oklch(0.276 0.007 111.481);
  --muted-foreground: oklch(0.824 0.021 111.489);
  --popover: oklch(0.103 0.014 289.411);
  --popover-foreground: oklch(0.975 0.003 290.955);
  --card: oklch(0.103 0.014 289.411);
  --card-foreground: oklch(0.975 0.003 290.955);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.725 0.06 289.4);
  --primary-foreground: oklch(0.202 0.031 287.867);
  --secondary: oklch(0.824 0.056 112.265);
  --secondary-foreground: oklch(0.253 0.028 113.031);
  --accent: oklch(0.824 0.056 112.265);
  --accent-foreground: oklch(0.253 0.028 113.031);
  --destructive: oklch(0.6 0.239 29.245);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.725 0.06 289.4);
  --chart-1: oklch(0.725 0.06 289.4);
  --chart-2: oklch(0.824 0.056 112.265);
  --chart-3: oklch(0.824 0.056 112.265);
  --chart-4: oklch(0.843 0.05 112.111);
  --chart-5: oklch(0.72 0.066 289.201);
}