Patch for shadcn/ui

Patch is a shadcn/ui theme built around a red primary color (#a42830) with near-white accents (#e9e7e7). The light mode uses a neutral background (#ffffff). Dark mode keeps the red primary (#a42830) on a red-tinted background (#0f0606).

Color palette

TokenLightDark
Background
#ffffffwhite
#0f0606black
Foreground
#0f0506black
#f9f6f6whitesmoke
Card
#ffffffwhite
#0f0606black
Card foreground
#0f0506black
#f9f6f6whitesmoke
Popover
#ffffffwhite
#0f0606black
Popover foreground
#0f0506black
#f9f6f6whitesmoke
Primary
#a42830brown
#a42830brown
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#e9e7e7linen
#2e2929darkslategray
Secondary foreground
#514d4ddarkslategray
#c7c1c2silver
Muted
#eee7e8linen
#181112black
Muted foreground
#634b4cdimgray
#b49c9edarkgray
Accent
#e9e7e7linen
#2e2929darkslategray
Accent foreground
#514d4ddarkslategray
#c7c1c2silver
Destructive
#cf4a07chocolate
#ec5409orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#a42830brown
#a42830brown

Contrast

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

Light mode
Text on background20.10:1AAA
Text on card20.10:1AAA
Primary button7.17:1AAA
Secondary button6.78:1AA
Muted text6.53:1AA
Accent6.78:1AA
Destructive4.54:1AA
Dark mode
Text on background18.66:1AAA
Text on card18.66:1AAA
Primary button7.17:1AAA
Secondary button8.07:1AAA
Muted text7.26:1AAA
Accent8.07:1AAA
Destructive3.58:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.134 0.021 14.736);
  --muted: oklch(0.934 0.007 12.585);
  --muted-foreground: oklch(0.437 0.033 14.048);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.134 0.021 14.736);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.134 0.021 14.736);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.478 0.16 22.412);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.93 0.001 12.46);
  --secondary-foreground: oklch(0.424 0.006 12.738);
  --accent: oklch(0.93 0.001 12.46);
  --accent-foreground: oklch(0.424 0.006 12.738);
  --destructive: oklch(0.585 0.18 40.266);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.478 0.16 22.412);
  --chart-1: oklch(0.478 0.16 22.412);
  --chart-2: oklch(0.93 0.001 12.46);
  --chart-3: oklch(0.93 0.001 12.46);
  --chart-4: oklch(0.954 0.001 12.448);
  --chart-5: oklch(0.481 0.166 22.989);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.135 0.019 14.429);
  --foreground: oklch(0.975 0.004 12.511);
  --muted: oklch(0.187 0.011 13.669);
  --muted-foreground: oklch(0.715 0.029 13.275);
  --popover: oklch(0.135 0.019 14.429);
  --popover-foreground: oklch(0.975 0.004 12.511);
  --card: oklch(0.135 0.019 14.429);
  --card-foreground: oklch(0.975 0.004 12.511);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.478 0.16 22.412);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.286 0.006 12.894);
  --secondary-foreground: oklch(0.817 0.007 12.595);
  --accent: oklch(0.286 0.006 12.894);
  --accent-foreground: oklch(0.817 0.007 12.595);
  --destructive: oklch(0.645 0.2 40.011);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.478 0.16 22.412);
  --chart-1: oklch(0.478 0.16 22.412);
  --chart-2: oklch(0.286 0.006 12.894);
  --chart-3: oklch(0.286 0.006 12.894);
  --chart-4: oklch(0.316 0.007 12.913);
  --chart-5: oklch(0.481 0.166 22.989);
}