Moral for shadcn/ui

Moral is a shadcn/ui theme built around a vivid purple primary color (#de88f6) with muted light purple accents (#cdb5d4). The light mode uses a neutral background (#fdfbfe). Dark mode keeps the vivid purple primary (#de88f6) on a neutral background (#030104).

Color palette

TokenLightDark
Background
#fdfbfewhite
#030104black
Foreground
#110514black
#fdfcfdwhite
Card
#fdfbfewhite
#030104black
Card foreground
#110514black
#fdfcfdwhite
Popover
#fdfbfewhite
#030104black
Popover foreground
#110514black
#fdfcfdwhite
Primary
#de88f6violet
#de88f6violet
Primary foreground
#390547midnightblue
#390547midnightblue
Secondary
#dfd5e2gainsboro
#332c35darkslategray
Secondary foreground
#49364edarkslategray
#ccc5celightgrey
Muted
#e7dce9gainsboro
#201623black
Muted foreground
#676567dimgray
#9a989adarkgray
Accent
#cdb5d4thistle
#48384ddarkslategray
Accent foreground
#322037darkslategray
#dfd6e1gainsboro
Destructive
#7c150emaroon
#d32417firebrick
Destructive foreground
#f8c7c3pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#de88f6violet
#de88f6violet

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.98:1AA
Secondary button7.67:1AAA
Muted text4.36:1AA Large
Accent7.98:1AAA
Destructive7.07:1AAA
Dark mode
Text on background20.27:1AAA
Text on card20.27:1AAA
Primary button6.98:1AA
Secondary button8.01:1AAA
Muted text6.13:1AA
Accent7.63:1AAA
Destructive5.19:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 318.889);
  --foreground: oklch(0.146 0.038 319.154);
  --muted: oklch(0.908 0.02 318.883);
  --muted-foreground: oklch(0.509 0.004 318.888);
  --popover: oklch(0.991 0.005 318.889);
  --popover-foreground: oklch(0.146 0.038 319.154);
  --card: oklch(0.991 0.005 318.889);
  --card-foreground: oklch(0.146 0.038 319.154);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.757 0.175 318.689);
  --primary-foreground: oklch(0.259 0.116 317.3);
  --secondary: oklch(0.884 0.02 318.882);
  --secondary-foreground: oklch(0.365 0.047 318.828);
  --accent: oklch(0.803 0.05 318.868);
  --accent-foreground: oklch(0.276 0.047 318.787);
  --destructive: oklch(0.381 0.138 29.357);
  --destructive-foreground: oklch(0.872 0.057 23.057);
  --ring: oklch(0.757 0.175 318.689);
  --chart-1: oklch(0.757 0.175 318.689);
  --chart-2: oklch(0.884 0.02 318.882);
  --chart-3: oklch(0.803 0.05 318.868);
  --chart-4: oklch(0.909 0.016 318.884);
  --chart-5: oklch(0.756 0.18 318.672);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.086 0.014 320.289);
  --foreground: oklch(0.991 0.003 318.89);
  --muted: oklch(0.217 0.029 318.825);
  --muted-foreground: oklch(0.682 0.003 318.889);
  --popover: oklch(0.086 0.014 320.289);
  --popover-foreground: oklch(0.991 0.003 318.89);
  --card: oklch(0.086 0.014 320.289);
  --card-foreground: oklch(0.991 0.003 318.89);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.757 0.175 318.689);
  --primary-foreground: oklch(0.259 0.116 317.3);
  --secondary: oklch(0.304 0.018 318.869);
  --secondary-foreground: oklch(0.831 0.016 318.884);
  --accent: oklch(0.366 0.042 318.839);
  --accent-foreground: oklch(0.885 0.018 318.883);
  --destructive: oklch(0.559 0.21 29.592);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.757 0.175 318.689);
  --chart-1: oklch(0.757 0.175 318.689);
  --chart-2: oklch(0.304 0.018 318.869);
  --chart-3: oklch(0.366 0.042 318.839);
  --chart-4: oklch(0.334 0.021 318.868);
  --chart-5: oklch(0.756 0.18 318.672);
}