Sturdy for shadcn/ui

Sturdy is a shadcn/ui theme built around a deep violet primary color (#0c0811) with deep green accents (#0e1108). The light mode uses a neutral background (#faf8fc). Dark mode keeps the deep violet primary (#0c0811) on a neutral background (#020203).

Color palette

TokenLightDark
Background
#faf8fcghostwhite
#020203black
Foreground
#020104black
#faf9fbghostwhite
Card
#faf8fcghostwhite
#020203black
Card foreground
#020104black
#faf9fbghostwhite
Popover
#faf8fcghostwhite
#020203black
Popover foreground
#020104black
#faf9fbghostwhite
Primary
#0c0811black
#0c0811black
Primary foreground
#9e86c6mediumpurple
#9e86c6mediumpurple
Secondary
#0e1108black
#0e1108black
Secondary foreground
#7c9c49olivedrab
#7c9c49olivedrab
Muted
#f0f1efwhitesmoke
#10100eblack
Muted foreground
#454643darkslategray
#babcb9silver
Accent
#0e1108black
#0e1108black
Accent foreground
#7c9c49olivedrab
#7c9c49olivedrab
Destructive
#93320bsaddlebrown
#f06c38tomato
Destructive foreground
#fcdfd4antiquewhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0c0811black
#0c0811black

Contrast

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

Light mode
Text on background19.72:1AAA
Text on card19.72:1AAA
Primary button6.30:1AA
Secondary button6.07:1AA
Muted text8.37:1AAA
Accent6.07:1AA
Destructive6.17:1AA
Dark mode
Text on background19.76:1AAA
Text on card19.76:1AAA
Primary button6.30:1AA
Secondary button6.07:1AA
Muted text9.94:1AAA
Accent6.07:1AA
Destructive6.90:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.005 303.569);
  --foreground: oklch(0.079 0.019 304.676);
  --muted: oklch(0.956 0.003 123.685);
  --muted-foreground: oklch(0.393 0.005 123.819);
  --popover: oklch(0.982 0.005 303.569);
  --popover-foreground: oklch(0.079 0.019 304.676);
  --card: oklch(0.982 0.005 303.569);
  --card-foreground: oklch(0.079 0.019 304.676);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.145 0.021 301.833);
  --primary-foreground: oklch(0.665 0.097 301.426);
  --secondary: oklch(0.172 0.019 125.215);
  --secondary-foreground: oklch(0.65 0.116 126.764);
  --accent: oklch(0.172 0.019 125.215);
  --accent-foreground: oklch(0.65 0.116 126.764);
  --destructive: oklch(0.454 0.139 38.667);
  --destructive-foreground: oklch(0.925 0.035 42.835);
  --ring: oklch(0.145 0.021 301.833);
  --chart-1: oklch(0.145 0.021 301.833);
  --chart-2: oklch(0.172 0.019 125.215);
  --chart-3: oklch(0.172 0.019 125.215);
  --chart-4: oklch(0.215 0.028 125.769);
  --chart-5: oklch(0.144 0.022 301.744);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.009 304.116);
  --foreground: oklch(0.983 0.003 303.589);
  --muted: oklch(0.173 0.005 124.031);
  --muted-foreground: oklch(0.792 0.004 123.714);
  --popover: oklch(0.085 0.009 304.116);
  --popover-foreground: oklch(0.983 0.003 303.589);
  --card: oklch(0.085 0.009 304.116);
  --card-foreground: oklch(0.983 0.003 303.589);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.145 0.021 301.833);
  --primary-foreground: oklch(0.665 0.097 301.426);
  --secondary: oklch(0.172 0.019 125.215);
  --secondary-foreground: oklch(0.65 0.116 126.764);
  --accent: oklch(0.172 0.019 125.215);
  --accent-foreground: oklch(0.65 0.116 126.764);
  --destructive: oklch(0.684 0.176 40.703);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.145 0.021 301.833);
  --chart-1: oklch(0.145 0.021 301.833);
  --chart-2: oklch(0.172 0.019 125.215);
  --chart-3: oklch(0.172 0.019 125.215);
  --chart-4: oklch(0.215 0.028 125.769);
  --chart-5: oklch(0.144 0.022 301.744);
}