Porter for shadcn/ui

Porter is a shadcn/ui theme built around a violet primary color (#622895) with green accents (#5b9528). The light mode uses a neutral background (#ffffff). Dark mode keeps the violet primary (#622895) on a violet-tinted background (#0a070d).

Color palette

TokenLightDark
Background
#ffffffwhite
#0a070dblack
Foreground
#0b0212black
#f8f5fawhitesmoke
Card
#fcfcfcsnow
#0d0911black
Card foreground
#08020eblack
#faf8fcghostwhite
Popover
#fcfcfcsnow
#0d0911black
Popover foreground
#08020eblack
#faf8fcghostwhite
Primary
#622895rebeccapurple
#622895rebeccapurple
Primary foreground
#f8f3fcghostwhite
#f8f3fcghostwhite
Secondary
#5b9528olivedrab
#5b9528olivedrab
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e8eee2beige
#171d11black
Muted foreground
#515d46darkolivegreen
#adb9a2darkgray
Accent
#5b9528olivedrab
#5b9528olivedrab
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#7c1009maroon
#ef281aorangered
Destructive foreground
#fac0bclightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#622895rebeccapurple
#622895rebeccapurple

Contrast

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

Light mode
Text on background20.35:1AAA
Text on card20.04:1AAA
Primary button8.53:1AAA
Secondary button3.63:1AA Large
Muted text5.92:1AA
Accent3.63:1AA Large
Destructive6.88:1AA
Dark mode
Text on background18.50:1AAA
Text on card18.70:1AAA
Primary button8.53:1AAA
Secondary button3.63:1AA Large
Muted text8.37:1AAA
Accent3.63:1AA Large
Destructive4.20:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.122 0.044 309.814);
  --muted: oklch(0.942 0.019 129.983);
  --muted-foreground: oklch(0.461 0.039 130.674);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.11 0.039 311.719);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.11 0.039 311.719);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.418 0.17 304.228);
  --primary-foreground: oklch(0.97 0.013 309.654);
  --secondary: oklch(0.608 0.152 133.658);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.608 0.152 133.658);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.377 0.142 29.619);
  --destructive-foreground: oklch(0.86 0.067 23.251);
  --ring: oklch(0.418 0.17 304.228);
  --chart-1: oklch(0.418 0.17 304.228);
  --chart-2: oklch(0.608 0.152 133.658);
  --chart-3: oklch(0.608 0.152 133.658);
  --chart-4: oklch(0.643 0.162 133.698);
  --chart-5: oklch(0.417 0.176 303.8);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.138 0.015 309.594);
  --foreground: oklch(0.973 0.008 309.704);
  --muted: oklch(0.221 0.026 131.074);
  --muted-foreground: oklch(0.769 0.035 130.243);
  --popover: oklch(0.149 0.018 308.703);
  --popover-foreground: oklch(0.982 0.005 309.732);
  --card: oklch(0.149 0.018 308.703);
  --card-foreground: oklch(0.982 0.005 309.732);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.418 0.17 304.228);
  --primary-foreground: oklch(0.97 0.013 309.654);
  --secondary: oklch(0.608 0.152 133.658);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.608 0.152 133.658);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.612 0.232 29.631);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.418 0.17 304.228);
  --chart-1: oklch(0.418 0.17 304.228);
  --chart-2: oklch(0.608 0.152 133.658);
  --chart-3: oklch(0.608 0.152 133.658);
  --chart-4: oklch(0.643 0.162 133.698);
  --chart-5: oklch(0.417 0.176 303.8);
}