Moral for shadcn/ui

Moral is a shadcn/ui theme built around a neutral gray primary color (#d1d4ce) with neutral gray accents (#d4ced1). The light mode uses a neutral background (#fafdf7). Dark mode keeps the neutral gray primary (#d1d4ce) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fafdf7mintcream
#000000black
Foreground
#0c1703black
#fafaf9snow
Card
#fafdf7mintcream
#000000black
Card foreground
#0c1703black
#fafaf9snow
Popover
#fafdf7mintcream
#000000black
Popover foreground
#0c1703black
#fafaf9snow
Primary
#d1d4celightgrey
#d1d4celightgrey
Primary foreground
#383b35darkslategray
#383b35darkslategray
Secondary
#ced1d4lightgrey
#ced1d4lightgrey
Secondary foreground
#35383bdarkslategray
#35383bdarkslategray
Muted
#eaf0f6lavender
#090f15black
Muted foreground
#545c64dimgray
#9ba3abdarkgray
Accent
#d4ced1lightgrey
#d4ced1lightgrey
Accent foreground
#3b3538darkslategray
#3b3538darkslategray
Destructive
#860604darkred
#f81512red
Destructive foreground
#fdc0bflightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d1d4celightgrey
#d1d4celightgrey

Contrast

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

Light mode
Text on background17.97:1AAA
Text on card17.97:1AAA
Primary button7.59:1AAA
Secondary button7.69:1AAA
Muted text5.89:1AA
Accent7.74:1AAA
Destructive6.61:1AA
Dark mode
Text on background20.10:1AAA
Text on card20.10:1AAA
Primary button7.59:1AAA
Secondary button7.69:1AAA
Muted text7.52:1AAA
Accent7.74:1AAA
Destructive4.11:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.01 129.228);
  --foreground: oklch(0.187 0.042 130.554);
  --muted: oklch(0.951 0.01 249.749);
  --muted-foreground: oklch(0.469 0.017 249.974);
  --popover: oklch(0.99 0.01 129.228);
  --popover-foreground: oklch(0.187 0.042 130.554);
  --card: oklch(0.99 0.01 129.228);
  --card-foreground: oklch(0.187 0.042 130.554);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.866 0.008 129.225);
  --primary-foreground: oklch(0.348 0.012 129.507);
  --secondary: oklch(0.859 0.005 249.704);
  --secondary-foreground: oklch(0.339 0.008 249.853);
  --accent: oklch(0.858 0.007 346.235);
  --accent-foreground: oklch(0.336 0.011 346.864);
  --destructive: oklch(0.392 0.156 29.091);
  --destructive-foreground: oklch(0.862 0.071 19.744);
  --ring: oklch(0.866 0.008 129.225);
  --chart-1: oklch(0.866 0.008 129.225);
  --chart-2: oklch(0.859 0.005 249.704);
  --chart-3: oklch(0.858 0.007 346.235);
  --chart-4: oklch(0.883 0.004 249.693);
  --chart-5: oklch(0.868 0.012 129.274);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.986 0.002 129.143);
  --muted: oklch(0.166 0.016 250.434);
  --muted-foreground: oklch(0.712 0.015 249.847);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.986 0.002 129.143);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.986 0.002 129.143);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.866 0.008 129.225);
  --primary-foreground: oklch(0.348 0.012 129.507);
  --secondary: oklch(0.859 0.005 249.704);
  --secondary-foreground: oklch(0.339 0.008 249.853);
  --accent: oklch(0.858 0.007 346.235);
  --accent-foreground: oklch(0.336 0.011 346.864);
  --destructive: oklch(0.619 0.247 28.939);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.866 0.008 129.225);
  --chart-1: oklch(0.866 0.008 129.225);
  --chart-2: oklch(0.859 0.005 249.704);
  --chart-3: oklch(0.858 0.007 346.235);
  --chart-4: oklch(0.883 0.004 249.693);
  --chart-5: oklch(0.868 0.012 129.274);
}