Rock for shadcn/ui

Rock is a shadcn/ui theme built around a green primary color (#367855) with neutral gray accents (#c8c1c1). The light mode uses a neutral background (#fcfdfc). Dark mode keeps the green primary (#367855) on a neutral background (#020302).

Color palette

TokenLightDark
Background
#fcfdfcwhite
#020302black
Foreground
#000000black
#f4faf7whitesmoke
Card
#fcfdfcwhite
#020302black
Card foreground
#000000black
#f4faf7whitesmoke
Popover
#fcfdfcwhite
#020302black
Popover foreground
#000000black
#f4faf7whitesmoke
Primary
#367855seagreen
#367855seagreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#dededegainsboro
#242926darkslategray
Secondary foreground
#454545darkslategray
#bbc3bfsilver
Muted
#f3ececlinen
#0c130fblack
Muted foreground
#4e4646darkslategray
#b1b9b5silver
Accent
#c8c1c1silver
#2d3e35darkslategray
Accent foreground
#2e2929darkslategray
#c7d6celightgrey
Destructive
#c64306chocolate
#f25207orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#367855seagreen
#367855seagreen

Contrast

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

Light mode
Text on background20.62:1AAA
Text on card20.62:1AAA
Primary button5.31:1AA
Secondary button7.11:1AAA
Muted text7.88:1AAA
Accent8.07:1AAA
Destructive5.00:1AA
Dark mode
Text on background19.51:1AAA
Text on card19.51:1AAA
Primary button5.31:1AA
Secondary button8.25:1AAA
Muted text9.39:1AAA
Accent7.51:1AAA
Destructive3.50:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.993 0.002 163.389);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.949 0.008 17.296);
  --muted-foreground: oklch(0.402 0.01 17.576);
  --popover: oklch(0.993 0.002 163.389);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.993 0.002 163.389);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.518 0.088 157.856);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.9 0 188.746);
  --secondary-foreground: oklch(0.39 0 165.964);
  --accent: oklch(0.816 0.008 17.318);
  --accent-foreground: oklch(0.286 0.008 17.611);
  --destructive: oklch(0.562 0.177 39.134);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.518 0.088 157.856);
  --chart-1: oklch(0.518 0.088 157.856);
  --chart-2: oklch(0.9 0 188.746);
  --chart-3: oklch(0.816 0.008 17.318);
  --chart-4: oklch(0.923 0 153.435);
  --chart-5: oklch(0.524 0.094 157.427);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.095 0.007 163.484);
  --foreground: oklch(0.981 0.007 163.254);
  --muted: oklch(0.177 0.014 161.294);
  --muted-foreground: oklch(0.778 0.01 163.12);
  --popover: oklch(0.095 0.007 163.484);
  --popover-foreground: oklch(0.981 0.007 163.254);
  --card: oklch(0.095 0.007 163.484);
  --card-foreground: oklch(0.981 0.007 163.254);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.518 0.088 157.856);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.274 0.008 162.692);
  --secondary-foreground: oklch(0.81 0.01 163.125);
  --accent: oklch(0.346 0.027 161.267);
  --accent-foreground: oklch(0.863 0.02 162.842);
  --destructive: oklch(0.652 0.208 38.745);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.518 0.088 157.856);
  --chart-1: oklch(0.518 0.088 157.856);
  --chart-2: oklch(0.274 0.008 162.692);
  --chart-3: oklch(0.346 0.027 161.267);
  --chart-4: oklch(0.305 0.009 162.657);
  --chart-5: oklch(0.524 0.094 157.427);
}