Scratchy for shadcn/ui

Scratchy is a shadcn/ui theme built around a green primary color (#4ab577) with teal accents (#4ab5ac). The light mode uses a neutral background (#ffffff). Dark mode keeps the green primary (#4ab577) on a neutral background (#030705).

Color palette

TokenLightDark
Background
#ffffffwhite
#030705black
Foreground
#04150bblack
#f6f8f7whitesmoke
Card
#fcfcfcsnow
#050b07black
Card foreground
#031109black
#f9fbfamintcream
Popover
#ffffffwhite
#030705black
Popover foreground
#04150bblack
#f6f8f7whitesmoke
Primary
#4ab577mediumseagreen
#4ab577mediumseagreen
Primary foreground
#0f2418black
#0f2418black
Secondary
#53b54amediumseagreen
#53b54amediumseagreen
Secondary foreground
#11240fblack
#11240fblack
Muted
#cee5cclightgrey
#1c331adarkgreen
Muted foreground
#475346darkslategray
#adb9acdarkgray
Accent
#4ab5accadetblue
#4ab5accadetblue
Accent foreground
#0f2422black
#0f2422black
Destructive
#c40e08firebrick
#dc1009red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4ab577mediumseagreen
#4ab577mediumseagreen

Contrast

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

Light mode
Text on background18.79:1AAA
Text on card18.88:1AAA
Primary button6.35:1AA
Secondary button6.29:1AA
Muted text6.07:1AA
Accent6.56:1AA
Destructive6.15:1AA
Dark mode
Text on background18.98:1AAA
Text on card19.13:1AAA
Primary button6.35:1AA
Secondary button6.29:1AA
Muted text6.72:1AA
Accent6.56:1AA
Destructive5.08:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.178 0.033 157.174);
  --muted: oklch(0.899 0.042 142.914);
  --muted-foreground: oklch(0.428 0.027 142.831);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.178 0.033 157.174);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.161 0.028 158.863);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.695 0.135 154.847);
  --primary-foreground: oklch(0.239 0.037 156.556);
  --secondary: oklch(0.691 0.173 142.003);
  --secondary-foreground: oklch(0.238 0.047 142.199);
  --accent: oklch(0.709 0.099 187.626);
  --accent-foreground: oklch(0.243 0.028 188.487);
  --destructive: oklch(0.519 0.207 29.254);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.695 0.135 154.847);
  --chart-1: oklch(0.695 0.135 154.847);
  --chart-2: oklch(0.691 0.173 142.003);
  --chart-3: oklch(0.709 0.099 187.626);
  --chart-4: oklch(0.708 0.164 142.064);
  --chart-5: oklch(0.703 0.143 154.429);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.121 0.013 160.962);
  --foreground: oklch(0.978 0.003 160.95);
  --muted: oklch(0.294 0.053 142.274);
  --muted-foreground: oklch(0.773 0.024 142.99);
  --popover: oklch(0.121 0.013 160.962);
  --popover-foreground: oklch(0.978 0.003 160.95);
  --card: oklch(0.139 0.015 160.914);
  --card-foreground: oklch(0.986 0.002 160.972);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.695 0.135 154.847);
  --primary-foreground: oklch(0.239 0.037 156.556);
  --secondary: oklch(0.691 0.173 142.003);
  --secondary-foreground: oklch(0.238 0.047 142.199);
  --accent: oklch(0.709 0.099 187.626);
  --accent-foreground: oklch(0.243 0.028 188.487);
  --destructive: oklch(0.566 0.227 29.271);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.695 0.135 154.847);
  --chart-1: oklch(0.695 0.135 154.847);
  --chart-2: oklch(0.691 0.173 142.003);
  --chart-3: oklch(0.709 0.099 187.626);
  --chart-4: oklch(0.708 0.164 142.064);
  --chart-5: oklch(0.703 0.143 154.429);
}