Alloy for shadcn/ui

Alloy is a shadcn/ui theme built around a vivid deep yellow primary color (#716605) with vivid deep purple accents (#660571). The light mode uses a neutral background (#fdfcf7). Dark mode keeps the vivid deep yellow primary (#716605) on a neutral background (#040302).

Color palette

TokenLightDark
Background
#fdfcf7snow
#040302black
Foreground
#000000black
#ffffffwhite
Card
#fcfbf3floralwhite
#070703black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfbf3floralwhite
#070703black
Popover foreground
#000000black
#ffffffwhite
Primary
#716605olive
#716605olive
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#057166teal
#057166teal
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#eef2f1whitesmoke
#0d1111black
Muted foreground
#4e6a67dimgray
#95b1aedarkgray
Accent
#660571purple
#660571purple
Accent foreground
#f4acfcplum
#f4acfcplum
Destructive
#830707maroon
#df0c0cred
Destructive foreground
#fcc0c0lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#716605olive
#716605olive

Contrast

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

Light mode
Text on background20.45:1AAA
Text on card20.19:1AAA
Primary button5.84:1AA
Secondary button5.92:1AA
Muted text5.17:1AA
Accent6.67:1AA
Destructive6.73:1AA
Dark mode
Text on background20.59:1AAA
Text on card20.19:1AAA
Primary button5.84:1AA
Secondary button5.92:1AA
Muted text8.29:1AAA
Accent6.67:1AA
Destructive5.01:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.007 101.396);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.957 0.004 189.983);
  --muted-foreground: oklch(0.5 0.033 188.528);
  --popover: oklch(0.986 0.01 101.45);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.986 0.01 101.45);
  --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.504 0.104 102.016);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.492 0.086 183.304);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.368 0.169 323.138);
  --accent-foreground: oklch(0.838 0.132 323.205);
  --destructive: oklch(0.386 0.153 28.514);
  --destructive-foreground: oklch(0.862 0.069 18.581);
  --ring: oklch(0.504 0.104 102.016);
  --chart-1: oklch(0.504 0.104 102.016);
  --chart-2: oklch(0.492 0.086 183.304);
  --chart-3: oklch(0.368 0.169 323.138);
  --chart-4: oklch(0.537 0.094 183.175);
  --chart-5: oklch(0.509 0.106 101.924);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.1 0.01 103.687);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.174 0.006 189.296);
  --muted-foreground: oklch(0.739 0.03 189.118);
  --popover: oklch(0.125 0.012 103.687);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.125 0.012 103.687);
  --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.504 0.104 102.016);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.492 0.086 183.304);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.368 0.169 323.138);
  --accent-foreground: oklch(0.838 0.132 323.205);
  --destructive: oklch(0.57 0.23 28.845);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.504 0.104 102.016);
  --chart-1: oklch(0.504 0.104 102.016);
  --chart-2: oklch(0.492 0.086 183.304);
  --chart-3: oklch(0.368 0.169 323.138);
  --chart-4: oklch(0.537 0.094 183.175);
  --chart-5: oklch(0.509 0.106 101.924);
}