Nutrition for shadcn/ui

Nutrition is a shadcn/ui theme built around a light indigo primary color (#bab4e9) with muted light indigo accents (#d3d2da). The light mode uses a neutral background (#f8f8fc). Dark mode keeps the light indigo primary (#bab4e9) on an indigo-tinted background (#060510).

Color palette

TokenLightDark
Background
#f8f8fcghostwhite
#060510black
Foreground
#000000black
#ffffffwhite
Card
#f8f8fcghostwhite
#060510black
Card foreground
#000000black
#ffffffwhite
Popover
#f8f8fcghostwhite
#060510black
Popover foreground
#000000black
#ffffffwhite
Primary
#bab4e9lightsteelblue
#bab4e9lightsteelblue
Primary foreground
#1e1952midnightblue
#1e1952midnightblue
Secondary
#e7e7e9lavender
#1d1d26black
Secondary foreground
#4d4d51darkslategray
#b2b1c4silver
Muted
#e5e5eblavender
#14141ablack
Muted foreground
#424243darkslategray
#bcbcbdsilver
Accent
#d3d2dalightgrey
#302d48darkslategray
Accent foreground
#383743darkslategray
#cccadelightgrey
Destructive
#601106maroon
#e1270eorangered
Destructive foreground
#f9aa9flightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#bab4e9lightsteelblue
#bab4e9lightsteelblue

Contrast

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

Light mode
Text on background19.82:1AAA
Text on card19.82:1AAA
Primary button8.21:1AAA
Secondary button6.83:1AA
Muted text8.00:1AAA
Accent7.80:1AAA
Destructive7.15:1AAA
Dark mode
Text on background20.28:1AAA
Text on card20.28:1AAA
Primary button8.21:1AAA
Secondary button7.96:1AAA
Muted text9.67:1AAA
Accent8.18:1AAA
Destructive4.65:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.005 290.912);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.924 0.009 290.837);
  --muted-foreground: oklch(0.378 0.002 290.903);
  --popover: oklch(0.98 0.005 290.912);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.98 0.005 290.912);
  --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.793 0.074 289.182);
  --primary-foreground: oklch(0.26 0.101 281.249);
  --secondary: oklch(0.93 0.002 290.976);
  --secondary-foreground: oklch(0.421 0.008 290.663);
  --accent: oklch(0.867 0.011 290.77);
  --accent-foreground: oklch(0.343 0.021 289.815);
  --destructive: oklch(0.32 0.114 31.232);
  --destructive-foreground: oklch(0.811 0.095 27.66);
  --ring: oklch(0.793 0.074 289.182);
  --chart-1: oklch(0.793 0.074 289.182);
  --chart-2: oklch(0.93 0.002 290.976);
  --chart-3: oklch(0.867 0.011 290.77);
  --chart-4: oklch(0.953 0.001 290.99);
  --chart-5: oklch(0.79 0.078 289.064);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.123 0.027 287.783);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.194 0.013 289.725);
  --muted-foreground: oklch(0.796 0.002 290.97);
  --popover: oklch(0.123 0.027 287.783);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.123 0.027 287.783);
  --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.793 0.074 289.182);
  --primary-foreground: oklch(0.26 0.101 281.249);
  --secondary: oklch(0.234 0.018 289.533);
  --secondary-foreground: oklch(0.766 0.027 290.333);
  --accent: oklch(0.313 0.048 287.889);
  --accent-foreground: oklch(0.846 0.028 290.392);
  --destructive: oklch(0.586 0.221 30.889);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.793 0.074 289.182);
  --chart-1: oklch(0.793 0.074 289.182);
  --chart-2: oklch(0.234 0.018 289.533);
  --chart-3: oklch(0.313 0.048 287.889);
  --chart-4: oklch(0.263 0.021 289.434);
  --chart-5: oklch(0.79 0.078 289.064);
}