Standard for shadcn/ui

Standard is a shadcn/ui theme built around a purple primary color (#7a1f7a) with green accents (#1f7a1f). The light mode uses a neutral background (#fefbfe). Dark mode keeps the purple primary (#7a1f7a) on a neutral background (#040104).

Color palette

TokenLightDark
Background
#fefbfewhite
#040104black
Foreground
#000000black
#f9f6f9whitesmoke
Card
#fefbfewhite
#040104black
Card foreground
#000000black
#f9f6f9whitesmoke
Popover
#fefbfewhite
#040104black
Popover foreground
#000000black
#f9f6f9whitesmoke
Primary
#7a1f7apurple
#7a1f7apurple
Primary foreground
#f5d6f5lavender
#f5d6f5lavender
Secondary
#1f7a1fforestgreen
#1f7a1fforestgreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e0e6e0gainsboro
#191f19black
Muted foreground
#4f594fdarkslategray
#a6b0a6darkgray
Accent
#1f7a1fforestgreen
#1f7a1fforestgreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#792906saddlebrown
#f35916orangered
Destructive foreground
#fbcbb6peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#7a1f7apurple
#7a1f7apurple

Contrast

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

Light mode
Text on background20.42:1AAA
Text on card20.42:1AAA
Primary button6.85:1AA
Secondary button5.41:1AA
Muted text5.76:1AA
Accent5.41:1AA
Destructive6.71:1AA
Dark mode
Text on background19.35:1AAA
Text on card19.35:1AAA
Primary button6.85:1AA
Secondary button5.41:1AA
Muted text7.47:1AAA
Accent5.41:1AA
Destructive3.37:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 325.618);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.919 0.012 145.481);
  --muted-foreground: oklch(0.453 0.021 145.225);
  --popover: oklch(0.991 0.005 325.618);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.991 0.005 325.618);
  --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.425 0.165 328.004);
  --primary-foreground: oklch(0.911 0.053 325.999);
  --secondary: oklch(0.509 0.152 142.931);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.509 0.152 142.931);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.397 0.12 39.714);
  --destructive-foreground: oklch(0.879 0.062 44.406);
  --ring: oklch(0.425 0.165 328.004);
  --chart-1: oklch(0.425 0.165 328.004);
  --chart-2: oklch(0.509 0.152 142.931);
  --chart-3: oklch(0.509 0.152 142.931);
  --chart-4: oklch(0.545 0.164 142.913);
  --chart-5: oklch(0.428 0.17 328.056);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.086 0.02 327.138);
  --foreground: oklch(0.976 0.004 325.61);
  --muted: oklch(0.232 0.016 145.032);
  --muted-foreground: oklch(0.746 0.018 145.39);
  --popover: oklch(0.086 0.02 327.138);
  --popover-foreground: oklch(0.976 0.004 325.61);
  --card: oklch(0.086 0.02 327.138);
  --card-foreground: oklch(0.976 0.004 325.61);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.425 0.165 328.004);
  --primary-foreground: oklch(0.911 0.053 325.999);
  --secondary: oklch(0.509 0.152 142.931);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.509 0.152 142.931);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.661 0.201 39.387);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.425 0.165 328.004);
  --chart-1: oklch(0.425 0.165 328.004);
  --chart-2: oklch(0.509 0.152 142.931);
  --chart-3: oklch(0.509 0.152 142.931);
  --chart-4: oklch(0.545 0.164 142.913);
  --chart-5: oklch(0.428 0.17 328.056);
}