Sardonic for shadcn/ui

Sardonic is a shadcn/ui theme built around a near-black primary color (#000000) with near-black accents (#000000). The light mode uses a neutral background (#fdf7f7). Dark mode keeps the near-black primary (#000000) on a neutral background (#030202).

Color palette

TokenLightDark
Background
#fdf7f7snow
#030202black
Foreground
#040101black
#fbf8f8snow
Card
#fcf3f3lavenderblush
#070404black
Card foreground
#000000black
#fdfcfcsnow
Popover
#fdf7f7snow
#030202black
Popover foreground
#040101black
#fbf8f8snow
Primary
#000000black
#000000black
Primary foreground
#999999darkgray
#999999darkgray
Secondary
#000000black
#000000black
Secondary foreground
#999999darkgray
#999999darkgray
Muted
#f1dfdfmistyrose
#200e0eblack
Muted foreground
#5a4444darkolivegreen
#bba5a5darkgray
Accent
#000000black
#000000black
Accent foreground
#999999darkgray
#999999darkgray
Destructive
#8e3606saddlebrown
#f67028tomato
Destructive foreground
#fddbc9bisque
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#000000black
#000000black

Contrast

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

Light mode
Text on background19.61:1AAA
Text on card19.22:1AAA
Primary button7.37:1AAA
Secondary button7.37:1AAA
Muted text6.98:1AA
Accent7.37:1AAA
Destructive6.04:1AA
Dark mode
Text on background19.63:1AAA
Text on card19.99:1AAA
Primary button7.37:1AAA
Secondary button7.37:1AAA
Muted text7.99:1AAA
Accent7.37:1AAA
Destructive7.25:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.006 17.267);
  --foreground: oklch(0.083 0.013 20.305);
  --muted: oklch(0.918 0.02 17.517);
  --muted-foreground: oklch(0.41 0.031 18.481);
  --popover: oklch(0.98 0.006 17.267);
  --popover-foreground: oklch(0.083 0.013 20.305);
  --card: oklch(0.971 0.01 17.324);
  --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 0 0);
  --primary-foreground: oklch(0.683 0 180);
  --secondary: oklch(0 0 0);
  --secondary-foreground: oklch(0.683 0 180);
  --accent: oklch(0 0 0);
  --accent-foreground: oklch(0.683 0 180);
  --destructive: oklch(0.451 0.131 42.514);
  --destructive-foreground: oklch(0.915 0.045 50.073);
  --ring: oklch(0 0 0);
  --chart-1: oklch(0 0 0);
  --chart-2: oklch(0 0 0);
  --chart-3: oklch(0 0 0);
  --chart-4: oklch(0.132 0 165.964);
  --chart-5: oklch(0 0 0);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.087 0.007 18.664);
  --foreground: oklch(0.983 0.003 17.215);
  --muted: oklch(0.19 0.031 20.322);
  --muted-foreground: oklch(0.741 0.026 17.752);
  --popover: oklch(0.087 0.007 18.664);
  --popover-foreground: oklch(0.983 0.003 17.215);
  --card: oklch(0.109 0.009 18.664);
  --card-foreground: oklch(0.991 0.002 17.186);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0 0 0);
  --primary-foreground: oklch(0.683 0 180);
  --secondary: oklch(0 0 0);
  --secondary-foreground: oklch(0.683 0 180);
  --accent: oklch(0 0 0);
  --accent-foreground: oklch(0.683 0 180);
  --destructive: oklch(0.697 0.183 44.654);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0 0 0);
  --chart-1: oklch(0 0 0);
  --chart-2: oklch(0 0 0);
  --chart-3: oklch(0 0 0);
  --chart-4: oklch(0.132 0 165.964);
  --chart-5: oklch(0 0 0);
}