Twin for shadcn/ui

Twin is a shadcn/ui theme built around a vivid violet primary color (#8662ea) with vivid green accents (#62ea86). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the vivid violet primary (#8662ea) on a violet-tinted background (#06040c).

Color palette

TokenLightDark
Background
#fcfbfewhite
#06040cblack
Foreground
#070212black
#ffffffwhite
Card
#fcfbfewhite
#06040cblack
Card foreground
#070212black
#ffffffwhite
Popover
#fcfbfewhite
#06040cblack
Popover foreground
#070212black
#ffffffwhite
Primary
#8662eamediumslateblue
#8662eamediumslateblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#ea8662salmon
#ea8662salmon
Secondary foreground
#160803black
#160803black
Muted
#f1ecealinen
#15100eblack
Muted foreground
#5e5350dimgray
#afa5a1darkgray
Accent
#62ea86mediumaquamarine
#62ea86mediumaquamarine
Accent foreground
#031608black
#031608black
Destructive
#79300bsaddlebrown
#ea631fchocolate
Destructive foreground
#f9d1bepeachpuff
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#8662eamediumslateblue
#8662eamediumslateblue

Contrast

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

Light mode
Text on background19.80:1AAA
Text on card19.80:1AAA
Primary button4.24:1AA Large
Secondary button7.54:1AAA
Muted text6.31:1AA
Accent12.10:1AAA
Destructive6.63:1AA
Dark mode
Text on background20.42:1AAA
Text on card20.42:1AAA
Primary button4.24:1AA Large
Secondary button7.54:1AAA
Muted text7.82:1AAA
Accent12.10:1AAA
Destructive6.29:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.005 298.485);
  --foreground: oklch(0.115 0.041 296.37);
  --muted: oklch(0.945 0.006 41.255);
  --muted-foreground: oklch(0.453 0.015 41.088);
  --popover: oklch(0.989 0.005 298.485);
  --popover-foreground: oklch(0.115 0.041 296.37);
  --card: oklch(0.989 0.005 298.485);
  --card-foreground: oklch(0.115 0.041 296.37);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.601 0.196 291.696);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.72 0.132 40.538);
  --secondary-foreground: oklch(0.156 0.029 47.269);
  --accent: oklch(0.837 0.182 149.541);
  --accent-foreground: oklch(0.18 0.04 151.379);
  --destructive: oklch(0.408 0.112 42.863);
  --destructive-foreground: oklch(0.891 0.052 48.114);
  --ring: oklch(0.601 0.196 291.696);
  --chart-1: oklch(0.601 0.196 291.696);
  --chart-2: oklch(0.72 0.132 40.538);
  --chart-3: oklch(0.837 0.182 149.541);
  --chart-4: oklch(0.742 0.12 40.655);
  --chart-5: oklch(0.598 0.203 291.311);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.114 0.023 298.288);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.18 0.009 41.003);
  --muted-foreground: oklch(0.73 0.013 41.174);
  --popover: oklch(0.114 0.023 298.288);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.114 0.023 298.288);
  --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.601 0.196 291.696);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.72 0.132 40.538);
  --secondary-foreground: oklch(0.156 0.029 47.269);
  --accent: oklch(0.837 0.182 149.541);
  --accent-foreground: oklch(0.18 0.04 151.379);
  --destructive: oklch(0.661 0.183 42.725);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.601 0.196 291.696);
  --chart-1: oklch(0.601 0.196 291.696);
  --chart-2: oklch(0.72 0.132 40.538);
  --chart-3: oklch(0.837 0.182 149.541);
  --chart-4: oklch(0.742 0.12 40.655);
  --chart-5: oklch(0.598 0.203 291.311);
}