sub for shadcn/ui

sub is a shadcn/ui theme built around a vivid light green primary color (#c4f8c4) with vivid light green accents (#c4f8c4). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid light green primary (#c4f8c4) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#051405black
#f5faf5whitesmoke
Card
#fefffdwhite
#000000black
Card foreground
#051405black
#f5faf5whitesmoke
Popover
#fcfdfcwhite
#000000black
Popover foreground
#051405black
#f5faf5whitesmoke
Primary
#c4f8c4lightgrey
#c4f8c4lightgrey
Primary foreground
#042004black
#042004black
Secondary
#e7e8e7lavender
#232a23darkslategray
Secondary foreground
#3e423edarkslategray
#bac5basilver
Muted
#eef2eewhitesmoke
#0d110dblack
Muted foreground
#4c574cdarkslategray
#a8b3a8darkgray
Accent
#c4f8c4lightgrey
#2a3c2adarkslategray
Accent foreground
#042004black
#c3d5c3silver
Destructive
#c02502firebrick
#fd4d26orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#eff0efwhitesmoke
#181b18black
Input
#eff0efwhitesmoke
#181b18black
Ring
#c4f8c4lightgrey
#c4f8c4lightgrey

Contrast

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

Light mode
Text on background18.94:1AAA
Text on card18.88:1AAA
Primary button14.47:1AAA
Secondary button8.34:1AAA
Muted text6.67:1AA
Accent14.47:1AAA
Destructive5.99:1AA
Dark mode
Text on background19.87:1AAA
Text on card19.87:1AAA
Primary button14.47:1AAA
Secondary button8.28:1AAA
Muted text8.74:1AAA
Accent7.68:1AAA
Destructive3.35:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.173 0.037 143.755);
  --muted: oklch(0.956 0.007 145.519);
  --muted-foreground: oklch(0.444 0.023 145.169);
  --popover: oklch(0.993 0.003 145.557);
  --popover-foreground: oklch(0.173 0.037 143.755);
  --card: oklch(0.999 0.002 131.08);
  --card-foreground: oklch(0.173 0.037 143.755);
  --border: oklch(0.955 0.003 145.556);
  --input: oklch(0.955 0.003 145.556);
  --primary: oklch(0.93 0.088 144.824);
  --primary-foreground: oklch(0.214 0.063 142.992);
  --secondary: oklch(0.931 0.003 145.555);
  --secondary-foreground: oklch(0.373 0.008 145.408);
  --accent: oklch(0.93 0.088 144.83);
  --accent-foreground: oklch(0.214 0.062 143.021);
  --destructive: oklch(0.523 0.194 32.585);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.93 0.088 144.824);
  --chart-1: oklch(0.93 0.088 144.824);
  --chart-2: oklch(0.512 0.009 145.449);
  --chart-3: oklch(0.827 0.019 145.405);
  --chart-4: oklch(0.909 0.003 145.55);
  --chart-5: oklch(0.931 0.091 144.796);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.979 0.008 145.514);
  --muted: oklch(0.173 0.011 145.079);
  --muted-foreground: oklch(0.755 0.021 145.368);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.979 0.008 145.514);
  --card: oklch(0 0 0);
  --card-foreground: oklch(0.979 0.008 145.514);
  --border: oklch(0.217 0.006 145.356);
  --input: oklch(0.217 0.006 145.356);
  --primary: oklch(0.93 0.088 144.824);
  --primary-foreground: oklch(0.214 0.063 142.992);
  --secondary: oklch(0.275 0.016 145.127);
  --secondary-foreground: oklch(0.811 0.02 145.386);
  --accent: oklch(0.334 0.038 144.678);
  --accent-foreground: oklch(0.854 0.03 145.305);
  --destructive: oklch(0.666 0.218 33.805);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.93 0.088 144.824);
  --chart-1: oklch(0.93 0.088 144.824);
  --chart-2: oklch(0.275 0.016 145.127);
  --chart-3: oklch(0.334 0.038 144.678);
  --chart-4: oklch(0.307 0.019 145.106);
  --chart-5: oklch(0.931 0.091 144.796);
}