Mandarin for shadcn/ui

Mandarin is a shadcn/ui theme built around a muted violet primary color (#856c93) with muted teal accents (#6c9385). The light mode uses a neutral background (#fbf7fd). Dark mode keeps the muted violet primary (#856c93) on a neutral background (#030104).

Color palette

TokenLightDark
Background
#fbf7fdghostwhite
#030104black
Foreground
#030104black
#f8f6f8whitesmoke
Card
#f9f2fcghostwhite
#060308black
Card foreground
#000000black
#faf9fbghostwhite
Popover
#f9f2fcghostwhite
#060308black
Popover foreground
#000000black
#faf9fbghostwhite
Primary
#856c93gray
#856c93gray
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#93856cgray
#93856cgray
Secondary foreground
#000000black
#000000black
Muted
#efece6linen
#191610black
Muted foreground
#494846darkslategray
#b9b8b6silver
Accent
#6c9385slategray
#6c9385slategray
Accent foreground
#000000black
#000000black
Destructive
#810c04maroon
#f71808red
Destructive foreground
#fdbebalightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#856c93gray
#856c93gray

Contrast

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

Light mode
Text on background19.58:1AAA
Text on card19.18:1AAA
Primary button4.58:1AA
Secondary button5.81:1AA
Muted text7.74:1AAA
Accent6.13:1AA
Destructive6.68:1AA
Dark mode
Text on background19.31:1AAA
Text on card19.57:1AAA
Primary button4.58:1AA
Secondary button5.81:1AA
Muted text9.12:1AAA
Accent6.13:1AA
Destructive4.11:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.01 314.165);
  --foreground: oklch(0.082 0.019 316.168);
  --muted: oklch(0.944 0.009 83.063);
  --muted-foreground: oklch(0.401 0.003 83.062);
  --popover: oklch(0.97 0.015 314.137);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.97 0.015 314.137);
  --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.57 0.064 313.593);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.623 0.039 82.92);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.63 0.047 171.177);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.384 0.149 29.99);
  --destructive-foreground: oklch(0.858 0.073 23.357);
  --ring: oklch(0.57 0.064 313.593);
  --chart-1: oklch(0.57 0.064 313.593);
  --chart-2: oklch(0.623 0.039 82.92);
  --chart-3: oklch(0.63 0.047 171.177);
  --chart-4: oklch(0.647 0.037 82.959);
  --chart-5: oklch(0.566 0.077 313.455);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.084 0.015 315.823);
  --foreground: oklch(0.976 0.003 314.204);
  --muted: oklch(0.201 0.012 82.933);
  --muted-foreground: oklch(0.783 0.003 83.058);
  --popover: oklch(0.106 0.019 315.823);
  --popover-foreground: oklch(0.984 0.002 314.21);
  --card: oklch(0.106 0.019 315.823);
  --card-foreground: oklch(0.984 0.002 314.21);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.57 0.064 313.593);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.623 0.039 82.92);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.63 0.047 171.177);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.619 0.246 29.746);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.57 0.064 313.593);
  --chart-1: oklch(0.57 0.064 313.593);
  --chart-2: oklch(0.623 0.039 82.92);
  --chart-3: oklch(0.63 0.047 171.177);
  --chart-4: oklch(0.647 0.037 82.959);
  --chart-5: oklch(0.566 0.077 313.455);
}