Upright for shadcn/ui

Upright is a shadcn/ui theme built around a vivid purple primary color (#d803b5) with muted light purple accents (#d8c5d5). The light mode uses a neutral background (#fefbfd). Dark mode keeps the vivid purple primary (#d803b5) on a neutral background (#080207).

Color palette

TokenLightDark
Background
#fefbfdsnow
#080207black
Foreground
#11040fblack
#fdfcfdwhite
Card
#fefbfdsnow
#080207black
Card foreground
#11040fblack
#fdfcfdwhite
Popover
#fefbfdsnow
#080207black
Popover foreground
#11040fblack
#fdfcfdwhite
Primary
#d803b5mediumvioletred
#d803b5mediumvioletred
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#d8c5d5thistle
#3c2a39darkslategray
Secondary foreground
#402b3cdarkslategray
#d5c3d2thistle
Muted
#f3ecf2whitesmoke
#130c12black
Muted foreground
#5c4759dimgray
#b8a3b4darkgray
Accent
#d8c5d5thistle
#3c2a39darkslategray
Accent foreground
#402b3cdarkslategray
#d5c3d2thistle
Destructive
#871903darkred
#f02c05orangered
Destructive foreground
#fec9bepink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d803b5mediumvioletred
#d803b5mediumvioletred

Contrast

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

Light mode
Text on background19.48:1AAA
Text on card19.48:1AAA
Primary button4.56:1AA
Secondary button7.91:1AAA
Muted text7.24:1AAA
Accent7.91:1AAA
Destructive6.60:1AA
Dark mode
Text on background20.05:1AAA
Text on card20.05:1AAA
Primary button4.56:1AA
Secondary button7.92:1AAA
Muted text8.21:1AAA
Accent7.92:1AAA
Destructive4.14:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.005 330.884);
  --foreground: oklch(0.136 0.037 333.211);
  --muted: oklch(0.951 0.011 330.974);
  --muted-foreground: oklch(0.427 0.04 332.026);
  --popover: oklch(0.991 0.005 330.884);
  --popover-foreground: oklch(0.136 0.037 333.211);
  --card: oklch(0.991 0.005 330.884);
  --card-foreground: oklch(0.136 0.037 333.211);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.6 0.262 337.957);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.844 0.029 331.281);
  --secondary-foreground: oklch(0.321 0.041 332.439);
  --accent: oklch(0.844 0.029 331.281);
  --accent-foreground: oklch(0.321 0.041 332.439);
  --destructive: oklch(0.405 0.148 32.677);
  --destructive-foreground: oklch(0.879 0.063 31.356);
  --ring: oklch(0.6 0.262 337.957);
  --chart-1: oklch(0.6 0.262 337.957);
  --chart-2: oklch(0.844 0.029 331.281);
  --chart-3: oklch(0.844 0.029 331.281);
  --chart-4: oklch(0.869 0.024 331.196);
  --chart-5: oklch(0.606 0.265 338.112);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.108 0.023 331.835);
  --foreground: oklch(0.992 0.002 330.844);
  --muted: oklch(0.166 0.017 332.121);
  --muted-foreground: oklch(0.739 0.035 331.443);
  --popover: oklch(0.108 0.023 331.835);
  --popover-foreground: oklch(0.992 0.002 330.844);
  --card: oklch(0.108 0.023 331.835);
  --card-foreground: oklch(0.992 0.002 330.844);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.6 0.262 337.957);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.312 0.035 332.261);
  --secondary-foreground: oklch(0.837 0.028 331.259);
  --accent: oklch(0.312 0.035 332.261);
  --accent-foreground: oklch(0.837 0.028 331.259);
  --destructive: oklch(0.615 0.232 31.881);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.6 0.262 337.957);
  --chart-1: oklch(0.6 0.262 337.957);
  --chart-2: oklch(0.312 0.035 332.261);
  --chart-3: oklch(0.312 0.035 332.261);
  --chart-4: oklch(0.341 0.039 332.301);
  --chart-5: oklch(0.606 0.265 338.112);
}