Ranger for shadcn/ui

Ranger is a shadcn/ui theme built around a light green primary color (#f1f8f4) with light orange accents (#f8f4f1). The light mode uses a neutral background (#fcfdfc). Dark mode keeps the light green primary (#f1f8f4) on a green-tinted background (#040c07).

Color palette

TokenLightDark
Background
#fcfdfcwhite
#040c07black
Foreground
#041109black
#f9fafaghostwhite
Card
#fcfdfcwhite
#040c07black
Card foreground
#041109black
#f9fafaghostwhite
Popover
#fcfdfcwhite
#040c07black
Popover foreground
#041109black
#f9fafaghostwhite
Primary
#f1f8f4whitesmoke
#f1f8f4whitesmoke
Primary foreground
#1b3726darkslategray
#1b3726darkslategray
Secondary
#f4f1f8whitesmoke
#f4f1f8whitesmoke
Secondary foreground
#563c7cdarkslateblue
#563c7cdarkslateblue
Muted
#efedf2whitesmoke
#0f0d12black
Muted foreground
#3f3a45darkslategray
#bebac5silver
Accent
#f8f4f1whitesmoke
#f8f4f1whitesmoke
Accent foreground
#37261bdarkslategray
#37261bdarkslategray
Destructive
#db0d06red
#ea0e06red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#f1f8f4whitesmoke
#f1f8f4whitesmoke

Contrast

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

Light mode
Text on background18.93:1AAA
Text on card18.93:1AAA
Primary button12.04:1AAA
Secondary button8.06:1AAA
Muted text9.52:1AAA
Accent13.22:1AAA
Destructive5.16:1AA
Dark mode
Text on background18.97:1AAA
Text on card18.97:1AAA
Primary button12.04:1AAA
Secondary button8.06:1AAA
Muted text10.14:1AAA
Accent13.22:1AAA
Destructive4.61:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.993 0.002 160.958);
  --foreground: oklch(0.16 0.026 159.042);
  --muted: oklch(0.95 0.006 304.951);
  --muted-foreground: oklch(0.358 0.021 304.252);
  --popover: oklch(0.993 0.002 160.958);
  --popover-foreground: oklch(0.16 0.026 159.042);
  --card: oklch(0.993 0.002 160.958);
  --card-foreground: oklch(0.16 0.026 159.042);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.974 0.009 160.787);
  --primary-foreground: oklch(0.309 0.046 156.726);
  --secondary: oklch(0.963 0.01 304.902);
  --secondary-foreground: oklch(0.416 0.106 301.146);
  --accent: oklch(0.97 0.006 58.276);
  --accent-foreground: oklch(0.287 0.032 56.555);
  --destructive: oklch(0.562 0.227 29.355);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.974 0.009 160.787);
  --chart-1: oklch(0.974 0.009 160.787);
  --chart-2: oklch(0.963 0.01 304.902);
  --chart-3: oklch(0.97 0.006 58.276);
  --chart-4: oklch(0.991 0.002 305.01);
  --chart-5: oklch(0.974 0.01 160.767);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.141 0.019 160.759);
  --foreground: oklch(0.985 0.001 160.981);
  --muted: oklch(0.164 0.01 304.202);
  --muted-foreground: oklch(0.795 0.017 304.753);
  --popover: oklch(0.141 0.019 160.759);
  --popover-foreground: oklch(0.985 0.001 160.981);
  --card: oklch(0.141 0.019 160.759);
  --card-foreground: oklch(0.985 0.001 160.981);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.974 0.009 160.787);
  --primary-foreground: oklch(0.309 0.046 156.726);
  --secondary: oklch(0.963 0.01 304.902);
  --secondary-foreground: oklch(0.416 0.106 301.146);
  --accent: oklch(0.97 0.006 58.276);
  --accent-foreground: oklch(0.287 0.032 56.555);
  --destructive: oklch(0.591 0.238 29.35);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.974 0.009 160.787);
  --chart-1: oklch(0.974 0.009 160.787);
  --chart-2: oklch(0.963 0.01 304.902);
  --chart-3: oklch(0.97 0.006 58.276);
  --chart-4: oklch(0.991 0.002 305.01);
  --chart-5: oklch(0.974 0.01 160.767);
}