Preface for shadcn/ui

Preface is a shadcn/ui theme built around a vivid orange primary color (#dc8409) with vivid blue accents (#0961dc). The light mode uses a neutral background (#fdfaf7). Dark mode keeps the vivid orange primary (#dc8409) on an orange-tinted background (#0e0b06).

Color palette

TokenLightDark
Background
#fdfaf7snow
#0e0b06black
Foreground
#160e03black
#fdfdfcwhite
Card
#fcf8f3floralwhite
#120e08black
Card foreground
#120b03black
#ffffffwhite
Popover
#fdfaf7snow
#0e0b06black
Popover foreground
#160e03black
#fdfdfcwhite
Primary
#dc8409chocolate
#dc8409chocolate
Primary foreground
#180f01black
#180f01black
Secondary
#0961dcroyalblue
#0961dcroyalblue
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#dbdde1gainsboro
#1e2124black
Muted foreground
#54585fdimgray
#a0a5abdarkgray
Accent
#0961dcroyalblue
#0961dcroyalblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#681508maroon
#d92c12firebrick
Destructive foreground
#f8b4aalightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#dc8409chocolate
#dc8409chocolate

Contrast

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

Light mode
Text on background18.42:1AAA
Text on card18.47:1AAA
Primary button6.65:1AA
Secondary button5.57:1AA
Muted text5.26:1AA
Accent5.57:1AA
Destructive7.12:1AAA
Dark mode
Text on background19.30:1AAA
Text on card19.28:1AAA
Primary button6.65:1AA
Secondary button5.57:1AA
Muted text6.53:1AA
Accent5.57:1AA
Destructive4.85:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.987 0.005 76.629);
  --foreground: oklch(0.172 0.027 78.297);
  --muted: oklch(0.898 0.005 256.676);
  --muted-foreground: oklch(0.46 0.012 256.738);
  --popover: oklch(0.987 0.005 76.629);
  --popover-foreground: oklch(0.172 0.027 78.297);
  --card: oklch(0.981 0.008 76.616);
  --card-foreground: oklch(0.157 0.024 80.994);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.693 0.154 64.567);
  --primary-foreground: oklch(0.176 0.034 79.358);
  --secondary: oklch(0.526 0.203 259.534);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.526 0.203 259.534);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.341 0.118 31.679);
  --destructive-foreground: oklch(0.832 0.081 28.74);
  --ring: oklch(0.693 0.154 64.567);
  --chart-1: oklch(0.693 0.154 64.567);
  --chart-2: oklch(0.526 0.203 259.534);
  --chart-3: oklch(0.526 0.203 259.534);
  --chart-4: oklch(0.551 0.214 259.588);
  --chart-5: oklch(0.698 0.157 63.864);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.151 0.012 78.616);
  --foreground: oklch(0.993 0.001 76.645);
  --muted: oklch(0.245 0.008 256.752);
  --muted-foreground: oklch(0.72 0.01 256.706);
  --popover: oklch(0.151 0.012 78.616);
  --popover-foreground: oklch(0.993 0.001 76.645);
  --card: oklch(0.165 0.013 76.554);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.693 0.154 64.567);
  --primary-foreground: oklch(0.176 0.034 79.358);
  --secondary: oklch(0.526 0.203 259.534);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.526 0.203 259.534);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.574 0.211 31.471);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.693 0.154 64.567);
  --chart-1: oklch(0.693 0.154 64.567);
  --chart-2: oklch(0.526 0.203 259.534);
  --chart-3: oklch(0.526 0.203 259.534);
  --chart-4: oklch(0.551 0.214 259.588);
  --chart-5: oklch(0.698 0.157 63.864);
}