Mechanism for shadcn/ui

Mechanism is a shadcn/ui theme built around a vivid deep indigo primary color (#0a0628) with vivid deep violet accents (#1c0628). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep indigo primary (#0a0628) on an indigo-tinted background (#07060f).

Color palette

TokenLightDark
Background
#ffffffwhite
#07060fblack
Foreground
#04030cblack
#ffffffwhite
Card
#ffffffwhite
#07060fblack
Card foreground
#04030cblack
#ffffffwhite
Popover
#ffffffwhite
#07060fblack
Popover foreground
#04030cblack
#ffffffwhite
Primary
#0a0628black
#0a0628black
Primary foreground
#d3cef8lavender
#d3cef8lavender
Secondary
#061228black
#061228black
Secondary foreground
#74a0eccornflowerblue
#74a0eccornflowerblue
Muted
#dbdde1gainsboro
#1e2024black
Muted foreground
#656667dimgray
#98999adarkgray
Accent
#1c0628black
#1c0628black
Accent foreground
#c074ecorchid
#c074ecorchid
Destructive
#d31609firebrick
#dc1709red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#0a0628black
#0a0628black

Contrast

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

Light mode
Text on background20.51:1AAA
Text on card20.51:1AAA
Primary button13.06:1AAA
Secondary button7.08:1AAA
Muted text4.23:1AA Large
Accent6.29:1AA
Destructive5.41:1AA
Dark mode
Text on background20.17:1AAA
Text on card20.17:1AAA
Primary button13.06:1AAA
Secondary button7.08:1AAA
Muted text5.68:1AA
Accent6.29:1AA
Destructive5.02:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.11 0.025 290.206);
  --muted: oklch(0.897 0.005 261.512);
  --muted-foreground: oklch(0.509 0.002 261.513);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.11 0.025 290.206);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.11 0.025 290.206);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.157 0.069 282.009);
  --primary-foreground: oklch(0.869 0.059 291.237);
  --secondary: oklch(0.186 0.049 259.667);
  --secondary-foreground: oklch(0.706 0.122 260.861);
  --accent: oklch(0.182 0.071 310.59);
  --accent-foreground: oklch(0.688 0.184 311.726);
  --destructive: oklch(0.55 0.217 29.76);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.157 0.069 282.009);
  --chart-1: oklch(0.157 0.069 282.009);
  --chart-2: oklch(0.186 0.049 259.667);
  --chart-3: oklch(0.182 0.071 310.59);
  --chart-4: oklch(0.216 0.062 260.332);
  --chart-5: oklch(0.156 0.071 281.473);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.129 0.021 290.533);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.245 0.007 261.481);
  --muted-foreground: oklch(0.682 0.002 261.513);
  --popover: oklch(0.129 0.021 290.533);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.129 0.021 290.533);
  --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.157 0.069 282.009);
  --primary-foreground: oklch(0.869 0.059 291.237);
  --secondary: oklch(0.186 0.049 259.667);
  --secondary-foreground: oklch(0.706 0.122 260.861);
  --accent: oklch(0.182 0.071 310.59);
  --accent-foreground: oklch(0.688 0.184 311.726);
  --destructive: oklch(0.569 0.225 29.757);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.157 0.069 282.009);
  --chart-1: oklch(0.157 0.069 282.009);
  --chart-2: oklch(0.186 0.049 259.667);
  --chart-3: oklch(0.182 0.071 310.59);
  --chart-4: oklch(0.216 0.062 260.332);
  --chart-5: oklch(0.156 0.071 281.473);
}