Fang for shadcn/ui

Fang is a shadcn/ui theme built around a vivid deep purple primary color (#370141) with muted light purple accents (#d7c8da). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the vivid deep purple primary (#370141) on a purple-tinted background (#0e0510).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#0e0510black
Foreground
#0c020dblack
#fbf9fbsnow
Card
#fbf8fcghostwhite
#120614black
Card foreground
#080109black
#fdfcfdwhite
Popover
#fdfcfdwhite
#0e0510black
Popover foreground
#0c020dblack
#fbf9fbsnow
Primary
#370141midnightblue
#370141midnightblue
Primary foreground
#e878fcviolet
#e878fcviolet
Secondary
#e7e3e8gainsboro
#2c242ddarkslategray
Secondary foreground
#524554darkslategray
#c7bbc9silver
Muted
#eee6eflavender
#181019black
Muted foreground
#453847darkslategray
#c5b8c7silver
Accent
#d7c8dathistle
#453249darkslategray
Accent foreground
#402d43darkslategray
#dccedegainsboro
Destructive
#ca3a16firebrick
#e6461eorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#370141midnightblue
#370141midnightblue

Contrast

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

Light mode
Text on background19.87:1AAA
Text on card19.59:1AAA
Primary button6.83:1AA
Secondary button7.08:1AAA
Muted text9.00:1AAA
Accent7.88:1AAA
Destructive5.07:1AA
Dark mode
Text on background19.16:1AAA
Text on card19.35:1AAA
Primary button6.83:1AA
Secondary button8.12:1AAA
Muted text9.83:1AAA
Accent7.73:1AAA
Destructive3.99:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 321.071);
  --foreground: oklch(0.119 0.038 323.027);
  --muted: oklch(0.934 0.015 321.1);
  --muted-foreground: oklch(0.361 0.031 321.244);
  --popover: oklch(0.991 0.003 321.071);
  --popover-foreground: oklch(0.119 0.038 323.027);
  --card: oklch(0.983 0.005 321.077);
  --card-foreground: oklch(0.104 0.033 323.519);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.247 0.115 320.856);
  --primary-foreground: oklch(0.749 0.212 321.44);
  --secondary: oklch(0.921 0.008 321.085);
  --secondary-foreground: oklch(0.409 0.03 321.22);
  --accent: oklch(0.851 0.029 321.138);
  --accent-foreground: oklch(0.329 0.044 321.328);
  --destructive: oklch(0.56 0.186 34.356);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.247 0.115 320.856);
  --chart-1: oklch(0.247 0.115 320.856);
  --chart-2: oklch(0.921 0.008 321.085);
  --chart-3: oklch(0.851 0.029 321.138);
  --chart-4: oklch(0.945 0.006 321.078);
  --chart-5: oklch(0.248 0.118 320.815);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.136 0.031 322.035);
  --foreground: oklch(0.984 0.003 321.073);
  --muted: oklch(0.187 0.022 321.305);
  --muted-foreground: oklch(0.797 0.026 321.135);
  --popover: oklch(0.136 0.031 322.035);
  --popover-foreground: oklch(0.984 0.003 321.073);
  --card: oklch(0.149 0.036 321.73);
  --card-foreground: oklch(0.992 0.002 321.069);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.247 0.115 320.856);
  --primary-foreground: oklch(0.749 0.212 321.44);
  --secondary: oklch(0.274 0.02 321.215);
  --secondary-foreground: oklch(0.806 0.023 321.126);
  --accent: oklch(0.347 0.047 321.332);
  --accent-foreground: oklch(0.868 0.025 321.128);
  --destructive: oklch(0.62 0.203 34.484);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.247 0.115 320.856);
  --chart-1: oklch(0.247 0.115 320.856);
  --chart-2: oklch(0.274 0.02 321.215);
  --chart-3: oklch(0.347 0.047 321.332);
  --chart-4: oklch(0.304 0.023 321.221);
  --chart-5: oklch(0.248 0.118 320.815);
}