Sudden for shadcn/ui

Sudden is a shadcn/ui theme built around a near-black primary color (#050307) with near-black accents (#050703). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the near-black primary (#050307) on a violet-tinted background (#08040b).

Color palette

TokenLightDark
Background
#fdfbfewhite
#08040bblack
Foreground
#030104black
#f8f6f8whitesmoke
Card
#fdfbfewhite
#08040bblack
Card foreground
#030104black
#f8f6f8whitesmoke
Popover
#fdfbfewhite
#08040bblack
Popover foreground
#030104black
#f8f6f8whitesmoke
Primary
#050307black
#050307black
Primary foreground
#a57dbfmediumpurple
#a57dbfmediumpurple
Secondary
#050703black
#050703black
Secondary foreground
#98bf7ddarkseagreen
#98bf7ddarkseagreen
Muted
#eff6eahoneydew
#0e1509black
Muted foreground
#5e605cdimgray
#a0a39fdarkgray
Accent
#050703black
#050703black
Accent foreground
#98bf7ddarkseagreen
#98bf7ddarkseagreen
Destructive
#c72505firebrick
#f9330borangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#050307black
#050307black

Contrast

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

Light mode
Text on background20.18:1AAA
Text on card20.18:1AAA
Primary button6.13:1AA
Secondary button9.72:1AAA
Muted text5.74:1AA
Accent9.72:1AAA
Destructive5.67:1AA
Dark mode
Text on background18.90:1AAA
Text on card18.90:1AAA
Primary button6.13:1AA
Secondary button9.72:1AAA
Muted text7.27:1AAA
Accent9.72:1AAA
Destructive3.82:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.004 312.325);
  --foreground: oklch(0.082 0.018 314.167);
  --muted: oklch(0.963 0.017 132.495);
  --muted-foreground: oklch(0.487 0.007 132.46);
  --popover: oklch(0.99 0.004 312.325);
  --popover-foreground: oklch(0.082 0.018 314.167);
  --card: oklch(0.99 0.004 312.325);
  --card-foreground: oklch(0.082 0.018 314.167);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.109 0.013 313.411);
  --primary-foreground: oklch(0.653 0.105 311.135);
  --secondary: oklch(0.122 0.012 131.45);
  --secondary-foreground: oklch(0.76 0.1 133.477);
  --accent: oklch(0.122 0.012 131.45);
  --accent-foreground: oklch(0.76 0.1 133.477);
  --destructive: oklch(0.536 0.199 32.12);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.109 0.013 313.411);
  --chart-1: oklch(0.109 0.013 313.411);
  --chart-2: oklch(0.122 0.012 131.45);
  --chart-3: oklch(0.122 0.012 131.45);
  --chart-4: oklch(0.169 0.019 133.127);
  --chart-5: oklch(0.108 0.015 313.514);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.12 0.023 313.781);
  --foreground: oklch(0.976 0.003 312.334);
  --muted: oklch(0.185 0.026 133.532);
  --muted-foreground: oklch(0.711 0.006 132.421);
  --popover: oklch(0.12 0.023 313.781);
  --popover-foreground: oklch(0.976 0.003 312.334);
  --card: oklch(0.12 0.023 313.781);
  --card-foreground: oklch(0.976 0.003 312.334);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.109 0.013 313.411);
  --primary-foreground: oklch(0.653 0.105 311.135);
  --secondary: oklch(0.122 0.012 131.45);
  --secondary-foreground: oklch(0.76 0.1 133.477);
  --accent: oklch(0.122 0.012 131.45);
  --accent-foreground: oklch(0.76 0.1 133.477);
  --destructive: oklch(0.636 0.235 32.146);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.109 0.013 313.411);
  --chart-1: oklch(0.109 0.013 313.411);
  --chart-2: oklch(0.122 0.012 131.45);
  --chart-3: oklch(0.122 0.012 131.45);
  --chart-4: oklch(0.169 0.019 133.127);
  --chart-5: oklch(0.108 0.015 313.514);
}