Walnut for shadcn/ui

Walnut is a shadcn/ui theme built around a vivid green primary color (#909f04) with vivid indigo accents (#14049f). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid green primary (#909f04) on a neutral background (#060703).

Color palette

TokenLightDark
Background
#ffffffwhite
#060703black
Foreground
#101103black
#f8f8f7whitesmoke
Card
#fcfcfcsnow
#0a0a05black
Card foreground
#0c0d02black
#fafaf9snow
Popover
#ffffffwhite
#060703black
Popover foreground
#101103black
#f8f8f7whitesmoke
Primary
#909f04olive
#909f04olive
Primary foreground
#000000black
#000000black
Secondary
#14049fdarkblue
#14049fdarkblue
Secondary foreground
#dbd7felavender
#dbd7felavender
Muted
#e7e6eflavender
#111019black
Muted foreground
#46454fdarkslategray
#b1b0badarkgray
Accent
#14049fdarkblue
#14049fdarkblue
Accent foreground
#dbd7felavender
#dbd7felavender
Destructive
#742006maroon
#f34612orangered
Destructive foreground
#fbc3b1lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#909f04olive
#909f04olive

Contrast

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

Light mode
Text on background19.02:1AAA
Text on card19.13:1AAA
Primary button7.14:1AAA
Secondary button9.79:1AAA
Muted text7.64:1AAA
Accent9.79:1AAA
Destructive6.93:1AA
Dark mode
Text on background19.01:1AAA
Text on card18.98:1AAA
Primary button7.14:1AAA
Secondary button9.79:1AAA
Muted text8.79:1AAA
Accent9.79:1AAA
Destructive3.69:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.173 0.03 113.591);
  --muted: oklch(0.929 0.012 290.779);
  --muted-foreground: oklch(0.394 0.017 290.171);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.173 0.03 113.591);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.154 0.026 113.048);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.667 0.152 116.515);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.326 0.214 268.078);
  --secondary-foreground: oklch(0.895 0.053 289.87);
  --accent: oklch(0.326 0.214 268.078);
  --accent-foreground: oklch(0.895 0.053 289.87);
  --destructive: oklch(0.376 0.123 35.931);
  --destructive-foreground: oklch(0.862 0.069 37.597);
  --ring: oklch(0.667 0.152 116.515);
  --chart-1: oklch(0.667 0.152 116.515);
  --chart-2: oklch(0.326 0.214 268.078);
  --chart-3: oklch(0.326 0.214 268.078);
  --chart-4: oklch(0.348 0.229 267.822);
  --chart-5: oklch(0.675 0.155 116.613);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.125 0.011 111.889);
  --foreground: oklch(0.979 0.002 111.053);
  --muted: oklch(0.179 0.018 289.077);
  --muted-foreground: oklch(0.761 0.015 290.648);
  --popover: oklch(0.125 0.011 111.889);
  --popover-foreground: oklch(0.979 0.002 111.053);
  --card: oklch(0.143 0.012 111.889);
  --card-foreground: oklch(0.986 0.001 111.039);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.667 0.152 116.515);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.326 0.214 268.078);
  --secondary-foreground: oklch(0.895 0.053 289.87);
  --accent: oklch(0.326 0.214 268.078);
  --accent-foreground: oklch(0.895 0.053 289.87);
  --destructive: oklch(0.641 0.216 35.237);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.667 0.152 116.515);
  --chart-1: oklch(0.667 0.152 116.515);
  --chart-2: oklch(0.326 0.214 268.078);
  --chart-3: oklch(0.326 0.214 268.078);
  --chart-4: oklch(0.348 0.229 267.822);
  --chart-5: oklch(0.675 0.155 116.613);
}