Tokyo Hack for shadcn/ui

Tokyo Hack is a shadcn/ui theme built around a vivid purple primary color (#f08ef0) with indigo accents (#2f2c77). The light mode uses an indigo-tinted background (#19173f). Dark mode keeps the vivid purple primary (#f08ef0) on an indigo-tinted background (#19173f).

Color palette

TokenLightDark
Background
#19173fmidnightblue
#19173fmidnightblue
Foreground
#ffffffwhite
#ffffffwhite
Card
#161538midnightblue
#161538midnightblue
Card foreground
#ffffffwhite
#ffffffwhite
Popover
#141334black
#141334black
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#f08ef0violet
#f08ef0violet
Primary foreground
#440944indigo
#440944indigo
Secondary
#532d53darkslategray
#532d53darkslategray
Secondary foreground
#e4cde4gainsboro
#e4cde4gainsboro
Muted
#302f3cdarkslategray
#302f3cdarkslategray
Muted foreground
#adacbedarkgray
#adacbedarkgray
Accent
#2f2c77midnightblue
#2f2c77midnightblue
Accent foreground
#e2e1f4lavender
#e2e1f4lavender
Destructive
#e0190bred
#e0190bred
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#25244cmidnightblue
#25244cmidnightblue
Input
#2a2957midnightblue
#2a2957midnightblue
Ring
#f08ef0violet
#f08ef0violet

Contrast

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

Light mode
Text on background16.95:1AAA
Text on card17.56:1AAA
Primary button7.20:1AAA
Secondary button7.60:1AAA
Muted text5.89:1AA
Accent9.33:1AAA
Destructive4.86:1AA
Dark mode
Text on background16.95:1AAA
Text on card17.56:1AAA
Primary button7.20:1AAA
Secondary button7.60:1AAA
Muted text5.89:1AA
Accent9.33:1AAA
Destructive4.86:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.234 0.074 280.546);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.312 0.023 286.518);
  --muted-foreground: oklch(0.751 0.025 287.306);
  --popover: oklch(0.211 0.063 281.071);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.219 0.066 280.881);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.285 0.072 282.28);
  --input: oklch(0.308 0.08 282.085);
  --primary: oklch(0.783 0.17 327.045);
  --primary-foreground: oklch(0.278 0.114 328.113);
  --secondary: oklch(0.36 0.08 327.079);
  --secondary-foreground: oklch(0.875 0.04 325.912);
  --accent: oklch(0.344 0.124 279.106);
  --accent-foreground: oklch(0.916 0.025 287.42);
  --destructive: oklch(0.576 0.227 29.757);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.783 0.17 327.045);
  --chart-1: oklch(0.783 0.17 327.045);
  --chart-2: oklch(0.36 0.08 327.079);
  --chart-3: oklch(0.344 0.124 279.106);
  --chart-4: oklch(0.388 0.088 327.103);
  --chart-5: oklch(0.783 0.176 327.092);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.234 0.074 280.546);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.312 0.023 286.518);
  --muted-foreground: oklch(0.751 0.025 287.306);
  --popover: oklch(0.211 0.063 281.071);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.219 0.066 280.881);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.285 0.072 282.28);
  --input: oklch(0.308 0.08 282.085);
  --primary: oklch(0.783 0.17 327.045);
  --primary-foreground: oklch(0.278 0.114 328.113);
  --secondary: oklch(0.36 0.08 327.079);
  --secondary-foreground: oklch(0.875 0.04 325.912);
  --accent: oklch(0.344 0.124 279.106);
  --accent-foreground: oklch(0.916 0.025 287.42);
  --destructive: oklch(0.576 0.227 29.757);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.783 0.17 327.045);
  --chart-1: oklch(0.783 0.17 327.045);
  --chart-2: oklch(0.36 0.08 327.079);
  --chart-3: oklch(0.344 0.124 279.106);
  --chart-4: oklch(0.388 0.088 327.103);
  --chart-5: oklch(0.783 0.176 327.092);
}