Walnut for shadcn/ui

Walnut is a shadcn/ui theme built around a light green primary color (#e7ecca) with light purple accents (#eccae7). The light mode uses a neutral background (#fcfdf7). Dark mode keeps the light green primary (#e7ecca) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fcfdf7snow
#000000black
Foreground
#141703black
#ffffffwhite
Card
#fcfdf7snow
#000000black
Card foreground
#141703black
#ffffffwhite
Popover
#fcfdf7snow
#000000black
Popover foreground
#141703black
#ffffffwhite
Primary
#e7eccaantiquewhite
#e7eccaantiquewhite
Primary foreground
#141708black
#141708black
Secondary
#cae7ecgainsboro
#cae7ecgainsboro
Secondary foreground
#225862darkslategray
#225862darkslategray
Muted
#f1f3f4whitesmoke
#0b0e0eblack
Muted foreground
#566467dimgray
#98a6a9darkgray
Accent
#eccae7gainsboro
#eccae7gainsboro
Accent foreground
#622258indigo
#622258indigo
Destructive
#8a1700darkred
#fa2a00orangered
Destructive foreground
#ffc8bdpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#e7eccaantiquewhite
#e7eccaantiquewhite

Contrast

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

Light mode
Text on background17.82:1AAA
Text on card17.82:1AAA
Primary button14.96:1AAA
Secondary button6.10:1AA
Muted text5.52:1AA
Accent7.51:1AAA
Destructive6.48:1AA
Dark mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button14.96:1AAA
Secondary button6.10:1AA
Muted text7.72:1AAA
Accent7.51:1AAA
Destructive3.89:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.992 0.009 114.231);
  --foreground: oklch(0.195 0.039 117.292);
  --muted: oklch(0.963 0.002 211.042);
  --muted-foreground: oklch(0.492 0.018 211.08);
  --popover: oklch(0.992 0.009 114.231);
  --popover-foreground: oklch(0.195 0.039 117.292);
  --card: oklch(0.992 0.009 114.231);
  --card-foreground: oklch(0.195 0.039 117.292);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.931 0.046 114.973);
  --primary-foreground: oklch(0.196 0.027 116.685);
  --secondary: oklch(0.908 0.031 211.073);
  --secondary-foreground: oklch(0.428 0.058 212.891);
  --accent: oklch(0.877 0.054 331.625);
  --accent-foreground: oklch(0.37 0.115 334.718);
  --destructive: oklch(0.409 0.152 32.684);
  --destructive-foreground: oklch(0.878 0.065 31.378);
  --ring: oklch(0.931 0.046 114.973);
  --chart-1: oklch(0.931 0.046 114.973);
  --chart-2: oklch(0.908 0.031 211.073);
  --chart-3: oklch(0.877 0.054 331.625);
  --chart-4: oklch(0.928 0.024 211.053);
  --chart-5: oklch(0.934 0.048 115.026);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.16 0.004 211.046);
  --muted-foreground: oklch(0.716 0.017 211.047);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0 0 0);
  --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.931 0.046 114.973);
  --primary-foreground: oklch(0.196 0.027 116.685);
  --secondary: oklch(0.908 0.031 211.073);
  --secondary-foreground: oklch(0.428 0.058 212.891);
  --accent: oklch(0.877 0.054 331.625);
  --accent-foreground: oklch(0.37 0.115 334.718);
  --destructive: oklch(0.632 0.242 31.66);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.931 0.046 114.973);
  --chart-1: oklch(0.931 0.046 114.973);
  --chart-2: oklch(0.908 0.031 211.073);
  --chart-3: oklch(0.877 0.054 331.625);
  --chart-4: oklch(0.928 0.024 211.053);
  --chart-5: oklch(0.934 0.048 115.026);
}