Turnstile for shadcn/ui

Turnstile is a shadcn/ui theme built around a muted violet primary color (#8975a9) with muted purple accents (#a375a9). The light mode uses a neutral background (#f9f6fd). Dark mode keeps the muted violet primary (#8975a9) on a neutral background (#050307).

Color palette

TokenLightDark
Background
#f9f6fdghostwhite
#050307black
Foreground
#0b0515black
#ffffffwhite
Card
#f6f2fdghostwhite
#07050ablack
Card foreground
#090411black
#ffffffwhite
Popover
#f9f6fdghostwhite
#050307black
Popover foreground
#0b0515black
#ffffffwhite
Primary
#8975a9lightslategray
#8975a9lightslategray
Primary foreground
#000000black
#000000black
Secondary
#757ba9lightslategray
#757ba9lightslategray
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e7e7eflavender
#101118black
Muted foreground
#585a6fdimgray
#9092a7lightslategray
Accent
#a375a9rosybrown
#a375a9rosybrown
Accent foreground
#000000black
#000000black
Destructive
#d9400dorangered
#d9400dorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#8975a9lightslategray
#8975a9lightslategray

Contrast

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

Light mode
Text on background18.80:1AAA
Text on card18.36:1AAA
Primary button5.17:1AA
Secondary button4.06:1AA Large
Muted text5.50:1AA
Accent5.66:1AA
Destructive4.48:1AA Large
Dark mode
Text on background20.52:1AAA
Text on card20.29:1AAA
Primary button5.17:1AA
Secondary button4.06:1AA Large
Muted text6.13:1AA
Accent5.66:1AA
Destructive4.48:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.978 0.01 303.493);
  --foreground: oklch(0.136 0.037 301.19);
  --muted: oklch(0.931 0.01 280.166);
  --muted-foreground: oklch(0.474 0.034 279.105);
  --popover: oklch(0.978 0.01 303.493);
  --popover-foreground: oklch(0.136 0.037 301.19);
  --card: oklch(0.968 0.015 303.416);
  --card-foreground: oklch(0.125 0.032 302.954);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.6 0.08 301.625);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.596 0.07 278.229);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.626 0.092 322.569);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.591 0.197 35.892);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.6 0.08 301.625);
  --chart-1: oklch(0.6 0.08 301.625);
  --chart-2: oklch(0.596 0.07 278.229);
  --chart-3: oklch(0.626 0.092 322.569);
  --chart-4: oklch(0.625 0.064 278.514);
  --chart-5: oklch(0.595 0.09 301.322);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.106 0.013 304.186);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.181 0.015 278.92);
  --muted-foreground: oklch(0.666 0.031 279.555);
  --popover: oklch(0.106 0.013 304.186);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.122 0.015 304.181);
  --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.6 0.08 301.625);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.596 0.07 278.229);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.626 0.092 322.569);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.591 0.197 35.892);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.6 0.08 301.625);
  --chart-1: oklch(0.6 0.08 301.625);
  --chart-2: oklch(0.596 0.07 278.229);
  --chart-3: oklch(0.626 0.092 322.569);
  --chart-4: oklch(0.625 0.064 278.514);
  --chart-5: oklch(0.595 0.09 301.322);
}