Sub for shadcn/ui

Sub is a shadcn/ui theme built around a green primary color (#41c530) with muted green accents (#a7c7a3). The light mode uses a neutral background (#fbfefb). Dark mode keeps the green primary (#41c530) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fbfefbwhite
#000000black
Foreground
#050b04black
#ffffffwhite
Card
#fbfefbwhite
#000000black
Card foreground
#050b04black
#ffffffwhite
Popover
#fbfefbwhite
#000000black
Popover foreground
#050b04black
#ffffffwhite
Primary
#41c530limegreen
#41c530limegreen
Primary foreground
#0b2108black
#0b2108black
Secondary
#c8d7c6lightgrey
#131613black
Secondary foreground
#2f3f2cdarkslategray
#a9b3a8darkgray
Muted
#e8f3e7honeydew
#0d180cblack
Muted foreground
#597156dimgray
#91a98edarkseagreen
Accent
#a7c7a3darkgray
#222c21darkslategray
Accent foreground
#172315black
#b8c9b6silver
Destructive
#ac210cfirebrick
#e02b10orangered
Destructive foreground
#feeeecseashell
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#41c530limegreen
#41c530limegreen

Contrast

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

Light mode
Text on background19.56:1AAA
Text on card19.56:1AAA
Primary button7.49:1AAA
Secondary button7.48:1AAA
Muted text4.70:1AA
Accent8.80:1AAA
Destructive6.27:1AA
Dark mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button7.49:1AAA
Secondary button8.42:1AAA
Muted text7.16:1AAA
Accent8.32:1AAA
Destructive4.63:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.004 142.098);
  --foreground: oklch(0.14 0.023 140.594);
  --muted: oklch(0.954 0.02 142.04);
  --muted-foreground: oklch(0.522 0.052 141.77);
  --popover: oklch(0.994 0.004 142.098);
  --popover-foreground: oklch(0.14 0.023 140.594);
  --card: oklch(0.994 0.004 142.098);
  --card-foreground: oklch(0.14 0.023 140.594);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.724 0.217 141.493);
  --primary-foreground: oklch(0.222 0.053 141.313);
  --secondary: oklch(0.863 0.027 142.003);
  --secondary-foreground: oklch(0.346 0.037 141.74);
  --accent: oklch(0.796 0.06 141.853);
  --accent-foreground: oklch(0.239 0.03 141.681);
  --destructive: oklch(0.483 0.177 31.487);
  --destructive-foreground: oklch(0.961 0.017 28.03);
  --ring: oklch(0.724 0.217 141.493);
  --chart-1: oklch(0.724 0.217 141.493);
  --chart-2: oklch(0.863 0.027 142.003);
  --chart-3: oklch(0.796 0.06 141.853);
  --chart-4: oklch(0.885 0.023 142.024);
  --chart-5: oklch(0.733 0.223 141.528);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.194 0.029 141.604);
  --muted-foreground: oklch(0.71 0.048 141.877);
  --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.724 0.217 141.493);
  --primary-foreground: oklch(0.222 0.053 141.313);
  --secondary: oklch(0.196 0.007 141.992);
  --secondary-foreground: oklch(0.756 0.02 142.023);
  --accent: oklch(0.28 0.025 141.803);
  --accent-foreground: oklch(0.817 0.032 141.977);
  --destructive: oklch(0.587 0.218 31.393);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.724 0.217 141.493);
  --chart-1: oklch(0.724 0.217 141.493);
  --chart-2: oklch(0.196 0.007 141.992);
  --chart-3: oklch(0.28 0.025 141.803);
  --chart-4: oklch(0.23 0.009 141.977);
  --chart-5: oklch(0.733 0.223 141.528);
}