Narrative for shadcn/ui

Narrative is a shadcn/ui theme built around a red primary color (#aa4a3c) with indigo accents (#4a3caa). The light mode uses a neutral background (#fdf8f7). Dark mode keeps the red primary (#aa4a3c) on a neutral background (#040201).

Color palette

TokenLightDark
Background
#fdf8f7snow
#040201black
Foreground
#160603black
#faf5f5whitesmoke
Card
#fcf4f3lavenderblush
#080303black
Card foreground
#120503black
#fcf9f8snow
Popover
#fdf8f7snow
#040201black
Popover foreground
#160603black
#faf5f5whitesmoke
Primary
#aa4a3csienna
#aa4a3csienna
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#3caa4aseagreen
#3caa4aseagreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#dbe1dcgainsboro
#1e241fblack
Muted foreground
#545454dimgray
#abababdarkgray
Accent
#4a3caadarkslateblue
#4a3caadarkslateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#812f08saddlebrown
#d84e0echocolate
Destructive foreground
#fbd3c1peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#aa4a3csienna
#aa4a3csienna

Contrast

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

Light mode
Text on background18.74:1AAA
Text on card18.46:1AAA
Primary button5.58:1AA
Secondary button2.98:1Fail
Muted text5.69:1AA
Accent8.35:1AAA
Destructive6.47:1AA
Dark mode
Text on background19.20:1AAA
Text on card19.55:1AAA
Primary button5.58:1AA
Secondary button2.98:1Fail
Muted text6.87:1AA
Accent8.35:1AAA
Destructive4.20:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.006 27.963);
  --foreground: oklch(0.149 0.032 34.324);
  --muted: oklch(0.903 0.009 149.554);
  --muted-foreground: oklch(0.446 0 180);
  --popover: oklch(0.982 0.006 27.963);
  --popover-foreground: oklch(0.149 0.032 34.324);
  --card: oklch(0.973 0.009 27.979);
  --card-foreground: oklch(0.136 0.027 35.249);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.531 0.129 30.709);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.653 0.168 145.605);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.439 0.169 283.005);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.419 0.123 40.865);
  --destructive-foreground: oklch(0.896 0.051 46.296);
  --ring: oklch(0.531 0.129 30.709);
  --chart-1: oklch(0.531 0.129 30.709);
  --chart-2: oklch(0.653 0.168 145.605);
  --chart-3: oklch(0.439 0.169 283.005);
  --chart-4: oklch(0.685 0.176 145.582);
  --chart-5: oklch(0.532 0.136 30.899);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.087 0.01 32.613);
  --foreground: oklch(0.975 0.005 27.958);
  --muted: oklch(0.253 0.013 149.032);
  --muted-foreground: oklch(0.741 0 171.254);
  --popover: oklch(0.087 0.01 32.613);
  --popover-foreground: oklch(0.975 0.005 27.958);
  --card: oklch(0.109 0.013 32.613);
  --card-foreground: oklch(0.983 0.003 27.95);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.531 0.129 30.709);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.653 0.168 145.605);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.439 0.169 283.005);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.604 0.185 39.887);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.531 0.129 30.709);
  --chart-1: oklch(0.531 0.129 30.709);
  --chart-2: oklch(0.653 0.168 145.605);
  --chart-3: oklch(0.439 0.169 283.005);
  --chart-4: oklch(0.685 0.176 145.582);
  --chart-5: oklch(0.532 0.136 30.899);
}