Upright for shadcn/ui

Upright is a shadcn/ui theme built around a muted deep indigo primary color (#161722) with muted deep violet accents (#1b1622). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep indigo primary (#161722) on an indigo-tinted background (#05050a).

Color palette

TokenLightDark
Background
#ffffffwhite
#05050ablack
Foreground
#000000black
#ffffffwhite
Card
#fcfcfcsnow
#06070eblack
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfcsnow
#06070eblack
Popover foreground
#000000black
#ffffffwhite
Primary
#161722black
#161722black
Primary foreground
#a6a8c4darkgray
#a6a8c4darkgray
Secondary
#161d22black
#161d22black
Secondary foreground
#a6b7c4silver
#a6b7c4silver
Muted
#dee4e8gainsboro
#171d21black
Muted foreground
#464d53darkslategray
#acb3b9darkgray
Accent
#1b1622black
#1b1622black
Accent foreground
#b3a6c4darkgray
#b3a6c4darkgray
Destructive
#961408darkred
#df1d0cred
Destructive foreground
#fdd7d3mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#161722black
#161722black

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.63:1AAA
Secondary button8.27:1AAA
Muted text6.67:1AA
Accent7.71:1AAA
Destructive6.59:1AA
Dark mode
Text on background20.32:1AAA
Text on card20.10:1AAA
Primary button7.63:1AAA
Secondary button8.27:1AAA
Muted text8.04:1AAA
Accent7.71:1AAA
Destructive4.86:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.915 0.009 240.42);
  --muted-foreground: oklch(0.417 0.013 240.707);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --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.21 0.021 281.265);
  --primary-foreground: oklch(0.74 0.04 282.148);
  --secondary: oklch(0.226 0.013 241.152);
  --secondary-foreground: oklch(0.771 0.026 240.761);
  --accent: oklch(0.213 0.023 304.302);
  --accent-foreground: oklch(0.746 0.044 304.952);
  --destructive: oklch(0.432 0.165 30.114);
  --destructive-foreground: oklch(0.91 0.043 24.1);
  --ring: oklch(0.21 0.021 281.265);
  --chart-1: oklch(0.21 0.021 281.265);
  --chart-2: oklch(0.226 0.013 241.152);
  --chart-3: oklch(0.213 0.023 304.302);
  --chart-4: oklch(0.258 0.016 241.226);
  --chart-5: oklch(0.207 0.024 280.924);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.119 0.014 279.984);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.226 0.013 241.105);
  --muted-foreground: oklch(0.764 0.011 240.48);
  --popover: oklch(0.132 0.016 280.061);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.132 0.016 280.061);
  --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.21 0.021 281.265);
  --primary-foreground: oklch(0.74 0.04 282.148);
  --secondary: oklch(0.226 0.013 241.152);
  --secondary-foreground: oklch(0.771 0.026 240.761);
  --accent: oklch(0.213 0.023 304.302);
  --accent-foreground: oklch(0.746 0.044 304.952);
  --destructive: oklch(0.576 0.224 30.075);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.21 0.021 281.265);
  --chart-1: oklch(0.21 0.021 281.265);
  --chart-2: oklch(0.226 0.013 241.152);
  --chart-3: oklch(0.213 0.023 304.302);
  --chart-4: oklch(0.258 0.016 241.226);
  --chart-5: oklch(0.207 0.024 280.924);
}