Commuter for shadcn/ui

Commuter is a shadcn/ui theme built around a violet primary color (#593078) with green accents (#4f7830). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the violet primary (#593078) on a violet-tinted background (#0b050f).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#0b050fblack
Foreground
#050208black
#fcfcfdwhite
Card
#faf8fcghostwhite
#0e0713black
Card foreground
#030104black
#ffffffwhite
Popover
#fdfcfdwhite
#0b050fblack
Popover foreground
#050208black
#fcfcfdwhite
Primary
#593078darkslateblue
#593078darkslateblue
Primary foreground
#eee5f5lavender
#eee5f5lavender
Secondary
#4f7830darkolivegreen
#4f7830darkolivegreen
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e5e9e2gainsboro
#191d16black
Muted foreground
#55624bdarkolivegreen
#a7b49ddarkgray
Accent
#4f7830darkolivegreen
#4f7830darkolivegreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#c7370ffirebrick
#e84011orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#593078darkslateblue
#593078darkslateblue

Contrast

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

Light mode
Text on background20.07:1AAA
Text on card19.71:1AAA
Primary button8.09:1AAA
Secondary button5.14:1AA
Muted text5.29:1AA
Accent5.14:1AA
Destructive5.26:1AA
Dark mode
Text on background19.61:1AAA
Text on card19.87:1AAA
Primary button8.09:1AAA
Secondary button5.14:1AA
Muted text7.84:1AAA
Accent5.14:1AA
Destructive4.04:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 311.062);
  --foreground: oklch(0.104 0.02 312.68);
  --muted: oklch(0.93 0.011 131.19);
  --muted-foreground: oklch(0.478 0.039 131.829);
  --popover: oklch(0.991 0.003 311.062);
  --popover-foreground: oklch(0.104 0.02 312.68);
  --card: oklch(0.982 0.005 311.039);
  --card-foreground: oklch(0.083 0.016 312.68);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.397 0.122 307.928);
  --primary-foreground: oklch(0.935 0.022 310.876);
  --secondary: oklch(0.527 0.112 133.607);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.527 0.112 133.607);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.552 0.187 34.683);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.397 0.122 307.928);
  --chart-1: oklch(0.397 0.122 307.928);
  --chart-2: oklch(0.527 0.112 133.607);
  --chart-3: oklch(0.527 0.112 133.607);
  --chart-4: oklch(0.56 0.12 133.64);
  --chart-5: oklch(0.395 0.13 307.627);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.133 0.025 310.994);
  --foreground: oklch(0.992 0.001 311.075);
  --muted: oklch(0.225 0.016 131.729);
  --muted-foreground: oklch(0.752 0.035 131.498);
  --popover: oklch(0.133 0.025 310.994);
  --popover-foreground: oklch(0.992 0.001 311.075);
  --card: oklch(0.144 0.028 309.911);
  --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.397 0.122 307.928);
  --primary-foreground: oklch(0.935 0.022 310.876);
  --secondary: oklch(0.527 0.112 133.607);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.527 0.112 133.607);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.618 0.211 34.547);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.397 0.122 307.928);
  --chart-1: oklch(0.397 0.122 307.928);
  --chart-2: oklch(0.527 0.112 133.607);
  --chart-3: oklch(0.527 0.112 133.607);
  --chart-4: oklch(0.56 0.12 133.64);
  --chart-5: oklch(0.395 0.13 307.627);
}