Accent for shadcn/ui

Accent is a shadcn/ui theme built around a near-white primary color (#fbf8fc) with neutral gray accents (#e4e2e4). The light mode uses a neutral background (#fefbfe). Dark mode keeps the near-white primary (#fbf8fc) on a purple-tinted background (#0a040b).

Color palette

TokenLightDark
Background
#fefbfewhite
#0a040bblack
Foreground
#130415black
#fdfcfdwhite
Card
#fefbfewhite
#0a040bblack
Card foreground
#130415black
#fdfcfdwhite
Popover
#fefbfewhite
#0a040bblack
Popover foreground
#130415black
#fdfcfdwhite
Primary
#fbf8fcghostwhite
#fbf8fcghostwhite
Primary foreground
#794280rebeccapurple
#794280rebeccapurple
Secondary
#e4e2e4gainsboro
#2c2a2ddarkslategray
Secondary foreground
#4c484cdarkslategray
#c6c3c6silver
Muted
#f1eef1whitesmoke
#100e11black
Muted foreground
#575158dimgray
#ada7aedarkgray
Accent
#e4e2e4gainsboro
#2c2a2ddarkslategray
Accent foreground
#4c484cdarkslategray
#c6c3c6silver
Destructive
#d35912chocolate
#e15f14chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fbf8fcghostwhite
#fbf8fcghostwhite

Contrast

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

Light mode
Text on background19.33:1AAA
Text on card19.33:1AAA
Primary button6.87:1AA
Secondary button6.96:1AA
Muted text6.70:1AA
Accent6.96:1AA
Destructive4.02:1AA Large
Dark mode
Text on background19.78:1AAA
Text on card19.78:1AAA
Primary button6.87:1AA
Secondary button8.13:1AAA
Muted text8.16:1AAA
Accent8.13:1AAA
Destructive3.58:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 322.13);
  --foreground: oklch(0.148 0.043 323.2);
  --muted: oklch(0.953 0.005 322.131);
  --muted-foreground: oklch(0.442 0.013 322.214);
  --popover: oklch(0.991 0.005 322.13);
  --popover-foreground: oklch(0.148 0.043 323.2);
  --card: oklch(0.991 0.005 322.13);
  --card-foreground: oklch(0.148 0.043 323.2);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.983 0.005 322.131);
  --primary-foreground: oklch(0.47 0.115 322.783);
  --secondary: oklch(0.915 0.003 322.123);
  --secondary-foreground: oklch(0.406 0.009 322.187);
  --accent: oklch(0.915 0.003 322.123);
  --accent-foreground: oklch(0.406 0.009 322.187);
  --destructive: oklch(0.612 0.17 44.221);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.983 0.005 322.131);
  --chart-1: oklch(0.983 0.005 322.131);
  --chart-2: oklch(0.915 0.003 322.123);
  --chart-3: oklch(0.915 0.003 322.123);
  --chart-4: oklch(0.938 0.002 322.12);
  --chart-5: oklch(0.983 0.006 322.133);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.125 0.021 323.38);
  --foreground: oklch(0.991 0.003 322.123);
  --muted: oklch(0.167 0.008 322.266);
  --muted-foreground: oklch(0.737 0.012 322.167);
  --popover: oklch(0.125 0.021 323.38);
  --popover-foreground: oklch(0.991 0.003 322.123);
  --card: oklch(0.125 0.021 323.38);
  --card-foreground: oklch(0.991 0.003 322.123);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.983 0.005 322.131);
  --primary-foreground: oklch(0.47 0.115 322.783);
  --secondary: oklch(0.289 0.006 322.18);
  --secondary-foreground: oklch(0.819 0.006 322.138);
  --accent: oklch(0.289 0.006 322.18);
  --accent-foreground: oklch(0.819 0.006 322.138);
  --destructive: oklch(0.642 0.179 44.112);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.983 0.005 322.131);
  --chart-1: oklch(0.983 0.005 322.131);
  --chart-2: oklch(0.289 0.006 322.18);
  --chart-3: oklch(0.289 0.006 322.18);
  --chart-4: oklch(0.319 0.007 322.182);
  --chart-5: oklch(0.983 0.006 322.133);
}