Fabric for shadcn/ui

Fabric is a shadcn/ui theme built around a vivid purple primary color (#c104c8) with vivid pink accents (#c8046d). The light mode uses a neutral background (#fdf6fd). Dark mode keeps the vivid purple primary (#c104c8) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#fdf6fdsnow
#070307black
Foreground
#040104black
#ffffffwhite
Card
#fcf2fdghostwhite
#0a050ablack
Card foreground
#000000black
#ffffffwhite
Popover
#fdf6fdsnow
#070307black
Popover foreground
#040104black
#ffffffwhite
Primary
#c104c8darkviolet
#c104c8darkviolet
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#5f04c8darkviolet
#5f04c8darkviolet
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#f0eef1whitesmoke
#0f0e11black
Muted foreground
#443b4fdarkslategray
#b9b0c4silver
Accent
#c8046dmediumvioletred
#c8046dmediumvioletred
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#9d0c02darkred
#fd4235tomato
Destructive foreground
#ffd5d2bisque
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#c104c8darkviolet
#c104c8darkviolet

Contrast

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

Light mode
Text on background19.61:1AAA
Text on card19.27:1AAA
Primary button5.08:1AA
Secondary button8.96:1AAA
Muted text9.19:1AAA
Accent5.69:1AA
Destructive6.33:1AA
Dark mode
Text on background20.45:1AAA
Text on card20.19:1AAA
Primary button5.08:1AA
Secondary button8.96:1AAA
Muted text9.22:1AAA
Accent5.69:1AA
Destructive3.49:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.012 324.693);
  --foreground: oklch(0.085 0.024 326.569);
  --muted: oklch(0.952 0.003 307.067);
  --muted-foreground: oklch(0.369 0.037 305.881);
  --popover: oklch(0.982 0.012 324.693);
  --popover-foreground: oklch(0.085 0.024 326.569);
  --card: oklch(0.972 0.017 324.732);
  --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.575 0.265 326.567);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.439 0.243 292.391);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.218 358.833);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.44 0.175 30.071);
  --destructive-foreground: oklch(0.907 0.047 22.872);
  --ring: oklch(0.575 0.265 326.567);
  --chart-1: oklch(0.575 0.265 326.567);
  --chart-2: oklch(0.439 0.243 292.391);
  --chart-3: oklch(0.541 0.218 358.833);
  --chart-4: oklch(0.463 0.256 292.203);
  --chart-5: oklch(0.581 0.269 326.551);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.111 0.014 325.578);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.167 0.005 306.718);
  --muted-foreground: oklch(0.771 0.031 306.623);
  --popover: oklch(0.111 0.014 325.578);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.128 0.017 325.578);
  --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.575 0.265 326.567);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.439 0.243 292.391);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.541 0.218 358.833);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.657 0.224 28.88);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.575 0.265 326.567);
  --chart-1: oklch(0.575 0.265 326.567);
  --chart-2: oklch(0.439 0.243 292.391);
  --chart-3: oklch(0.541 0.218 358.833);
  --chart-4: oklch(0.463 0.256 292.203);
  --chart-5: oklch(0.581 0.269 326.551);
}