Strap for shadcn/ui

Strap is a shadcn/ui theme built around a light purple primary color (#e7a2df) with light green accents (#a2e7aa). The light mode uses a neutral background (#fdf7fc). Dark mode keeps the light purple primary (#e7a2df) on a neutral background (#070307).

Color palette

TokenLightDark
Background
#fdf7fcsnow
#070307black
Foreground
#080207black
#fdfcfdwhite
Card
#fcf3fblavenderblush
#0b040ablack
Card foreground
#040104black
#ffffffwhite
Popover
#fcf3fblavenderblush
#0b040ablack
Popover foreground
#040104black
#ffffffwhite
Primary
#e7a2dfplum
#e7a2dfplum
Primary foreground
#45123fmidnightblue
#45123fmidnightblue
Secondary
#a2e7aapalegreen
#a2e7aapalegreen
Secondary foreground
#124518darkgreen
#124518darkgreen
Muted
#eef6efwhitesmoke
#09110ablack
Muted foreground
#3f5041darkslategray
#afc0b1silver
Accent
#a2e7aapalegreen
#a2e7aapalegreen
Accent foreground
#124518darkgreen
#124518darkgreen
Destructive
#6a200cmaroon
#d34017chocolate
Destructive foreground
#f6c0b1lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#e7a2dfplum
#e7a2dfplum

Contrast

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

Light mode
Text on background19.44:1AAA
Text on card19.11:1AAA
Primary button7.51:1AAA
Secondary button7.68:1AAA
Muted text7.85:1AAA
Accent7.68:1AAA
Destructive7.19:1AAA
Dark mode
Text on background20.01:1AAA
Text on card20.23:1AAA
Primary button7.51:1AAA
Secondary button7.68:1AAA
Muted text10.04:1AAA
Accent7.68:1AAA
Destructive4.64:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.982 0.009 329.245);
  --foreground: oklch(0.107 0.026 330.449);
  --muted: oklch(0.966 0.013 148.971);
  --muted-foreground: oklch(0.412 0.033 148.142);
  --popover: oklch(0.973 0.014 329.302);
  --popover-foreground: oklch(0.085 0.021 330.449);
  --card: oklch(0.973 0.014 329.302);
  --card-foreground: oklch(0.085 0.021 330.449);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.797 0.114 330.686);
  --primary-foreground: oklch(0.286 0.099 332.824);
  --secondary: oklch(0.866 0.109 147.516);
  --secondary-foreground: oklch(0.345 0.091 145.126);
  --accent: oklch(0.866 0.109 147.516);
  --accent-foreground: oklch(0.345 0.091 145.126);
  --destructive: oklch(0.357 0.109 35.693);
  --destructive-foreground: oklch(0.852 0.066 35.991);
  --ring: oklch(0.797 0.114 330.686);
  --chart-1: oklch(0.797 0.114 330.686);
  --chart-2: oklch(0.866 0.109 147.516);
  --chart-3: oklch(0.866 0.109 147.516);
  --chart-4: oklch(0.883 0.095 147.773);
  --chart-5: oklch(0.797 0.119 330.76);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.11 0.018 330.034);
  --foreground: oklch(0.992 0.002 329.152);
  --muted: oklch(0.166 0.02 147.755);
  --muted-foreground: oklch(0.791 0.028 148.705);
  --popover: oklch(0.126 0.02 330.111);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.126 0.02 330.111);
  --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.797 0.114 330.686);
  --primary-foreground: oklch(0.286 0.099 332.824);
  --secondary: oklch(0.866 0.109 147.516);
  --secondary-foreground: oklch(0.345 0.091 145.126);
  --accent: oklch(0.866 0.109 147.516);
  --accent-foreground: oklch(0.345 0.091 145.126);
  --destructive: oklch(0.582 0.19 35.135);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.797 0.114 330.686);
  --chart-1: oklch(0.797 0.114 330.686);
  --chart-2: oklch(0.866 0.109 147.516);
  --chart-3: oklch(0.866 0.109 147.516);
  --chart-4: oklch(0.883 0.095 147.773);
  --chart-5: oklch(0.797 0.119 330.76);
}