Sardonic for shadcn/ui

Sardonic is a shadcn/ui theme built around a muted green primary color (#4d5b4f) with muted purple accents (#5b4d59). The light mode uses a neutral background (#f7fdf8). Dark mode keeps the muted green primary (#4d5b4f) on a neutral background (#010402).

Color palette

TokenLightDark
Background
#f7fdf8mintcream
#010402black
Foreground
#010401black
#f6f9f6whitesmoke
Card
#f3fcf4honeydew
#020803black
Card foreground
#000000black
#f9fbf9mintcream
Popover
#f7fdf8mintcream
#010402black
Popover foreground
#010401black
#f6f9f6whitesmoke
Primary
#4d5b4fdarkslategray
#4d5b4fdarkslategray
Primary foreground
#ecefecwhitesmoke
#ecefecwhitesmoke
Secondary
#5b4d59dimgray
#5b4d59dimgray
Secondary foreground
#efeceewhitesmoke
#efeceewhitesmoke
Muted
#ede8edlavender
#171216black
Muted foreground
#6c5168dimgray
#ae93aadarkgray
Accent
#5b4d59dimgray
#5b4d59dimgray
Accent foreground
#efeceewhitesmoke
#efeceewhitesmoke
Destructive
#a4220efirebrick
#ec3d22orangered
Destructive foreground
#fdeae8linen
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4d5b4fdarkslategray
#4d5b4fdarkslategray

Contrast

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

Light mode
Text on background19.96:1AAA
Text on card20.02:1AAA
Primary button6.19:1AA
Secondary button6.72:1AA
Muted text5.75:1AA
Accent6.72:1AA
Destructive6.41:1AA
Dark mode
Text on background19.42:1AAA
Text on card19.44:1AAA
Primary button6.19:1AA
Secondary button6.72:1AA
Muted text6.66:1AA
Accent6.72:1AA
Destructive3.99:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.988 0.009 150.125);
  --foreground: oklch(0.098 0.02 148.939);
  --muted: oklch(0.936 0.009 330.369);
  --muted-foreground: oklch(0.471 0.049 331.516);
  --popover: oklch(0.988 0.009 150.125);
  --popover-foreground: oklch(0.098 0.02 148.939);
  --card: oklch(0.982 0.014 150.062);
  --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.455 0.025 149.51);
  --primary-foreground: oklch(0.948 0.004 150.186);
  --secondary: oklch(0.439 0.025 330.97);
  --secondary-foreground: oklch(0.945 0.004 330.307);
  --accent: oklch(0.439 0.025 330.97);
  --accent-foreground: oklch(0.945 0.004 330.307);
  --destructive: oklch(0.47 0.169 31.574);
  --destructive-foreground: oklch(0.952 0.021 28.055);
  --ring: oklch(0.455 0.025 149.51);
  --chart-1: oklch(0.455 0.025 149.51);
  --chart-2: oklch(0.439 0.025 330.97);
  --chart-3: oklch(0.439 0.025 330.97);
  --chart-4: oklch(0.466 0.027 330.979);
  --chart-5: oklch(0.459 0.034 149.234);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.097 0.016 149.222);
  --foreground: oklch(0.979 0.004 150.187);
  --muted: oklch(0.189 0.013 331.119);
  --muted-foreground: oklch(0.696 0.044 331.043);
  --popover: oklch(0.097 0.016 149.222);
  --popover-foreground: oklch(0.979 0.004 150.187);
  --card: oklch(0.122 0.02 149.222);
  --card-foreground: oklch(0.986 0.003 150.207);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.455 0.025 149.51);
  --primary-foreground: oklch(0.948 0.004 150.186);
  --secondary: oklch(0.439 0.025 330.97);
  --secondary-foreground: oklch(0.945 0.004 330.307);
  --accent: oklch(0.439 0.025 330.97);
  --accent-foreground: oklch(0.945 0.004 330.307);
  --destructive: oklch(0.622 0.215 31.656);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.455 0.025 149.51);
  --chart-1: oklch(0.455 0.025 149.51);
  --chart-2: oklch(0.439 0.025 330.97);
  --chart-3: oklch(0.439 0.025 330.97);
  --chart-4: oklch(0.466 0.027 330.979);
  --chart-5: oklch(0.459 0.034 149.234);
}