Crafty for shadcn/ui

Crafty is a shadcn/ui theme built around a near-black primary color (#010f02) with muted light green accents (#dce5dc). The light mode uses a neutral background (#ffffff). Dark mode keeps the near-black primary (#010f02) on a neutral background (#020803).

Color palette

TokenLightDark
Background
#ffffffwhite
#020803black
Foreground
#031704black
#fbfdfcwhite
Card
#ffffffwhite
#020803black
Card foreground
#031704black
#fbfdfcwhite
Popover
#ffffffwhite
#020803black
Popover foreground
#031704black
#fbfdfcwhite
Primary
#010f02black
#010f02black
Primary foreground
#0ad117limegreen
#0ad117limegreen
Secondary
#dce5dcgainsboro
#263627darkslategray
Secondary foreground
#3d523edarkslategray
#bdd0bfsilver
Muted
#d3e8d5gainsboro
#172c18black
Muted foreground
#384739darkslategray
#b8c7b9silver
Accent
#dce5dcgainsboro
#263627darkslategray
Accent foreground
#3d523edarkslategray
#bdd0bfsilver
Destructive
#831f0bmaroon
#eb3814orangered
Destructive foreground
#facfc7pink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#010f02black
#010f02black

Contrast

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

Light mode
Text on background18.61:1AAA
Text on card18.61:1AAA
Primary button9.50:1AAA
Secondary button6.57:1AA
Muted text7.67:1AAA
Accent6.57:1AA
Destructive6.80:1AA
Dark mode
Text on background19.79:1AAA
Text on card19.79:1AAA
Primary button9.50:1AAA
Secondary button7.91:1AAA
Muted text8.47:1AAA
Accent7.91:1AAA
Destructive4.12:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.18 0.049 144.946);
  --muted: oklch(0.911 0.035 147.16);
  --muted-foreground: oklch(0.381 0.031 146.703);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.18 0.049 144.946);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.18 0.049 144.946);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.146 0.042 145.123);
  --primary-foreground: oklch(0.748 0.25 142.852);
  --secondary: oklch(0.913 0.015 147.381);
  --secondary-foreground: oklch(0.415 0.042 146.475);
  --accent: oklch(0.913 0.015 147.381);
  --accent-foreground: oklch(0.415 0.042 146.475);
  --destructive: oklch(0.405 0.138 32.928);
  --destructive-foreground: oklch(0.89 0.05 31.259);
  --ring: oklch(0.146 0.042 145.123);
  --chart-1: oklch(0.146 0.042 145.123);
  --chart-2: oklch(0.913 0.015 147.381);
  --chart-3: oklch(0.913 0.015 147.381);
  --chart-4: oklch(0.935 0.011 147.426);
  --chart-5: oklch(0.146 0.044 145.036);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.122 0.023 146.128);
  --foreground: oklch(0.993 0.003 147.515);
  --muted: oklch(0.268 0.045 145.666);
  --muted-foreground: oklch(0.814 0.026 147.226);
  --popover: oklch(0.122 0.023 146.128);
  --popover-foreground: oklch(0.993 0.003 147.515);
  --card: oklch(0.122 0.023 146.128);
  --card-foreground: oklch(0.993 0.003 147.515);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.146 0.042 145.123);
  --primary-foreground: oklch(0.748 0.25 142.852);
  --secondary: oklch(0.313 0.033 146.434);
  --secondary-foreground: oklch(0.84 0.032 147.162);
  --accent: oklch(0.313 0.033 146.434);
  --accent-foreground: oklch(0.84 0.032 147.162);
  --destructive: oklch(0.615 0.219 32.63);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.146 0.042 145.123);
  --chart-1: oklch(0.146 0.042 145.123);
  --chart-2: oklch(0.313 0.033 146.434);
  --chart-3: oklch(0.313 0.033 146.434);
  --chart-4: oklch(0.345 0.038 146.396);
  --chart-5: oklch(0.146 0.044 145.036);
}