Necessary for shadcn/ui

Necessary is a shadcn/ui theme built around a light green primary color (#dbdfb9) with light indigo accents (#bdb9df). The light mode uses a neutral background (#ffffff). Dark mode keeps the light green primary (#dbdfb9) on a green-tinted background (#0a0b04).

Color palette

TokenLightDark
Background
#ffffffwhite
#0a0b04black
Foreground
#040401black
#ffffffwhite
Card
#fcfcfcsnow
#0e0f06black
Card foreground
#000000black
#ffffffwhite
Popover
#ffffffwhite
#0a0b04black
Popover foreground
#040401black
#ffffffwhite
Primary
#dbdfb9palegoldenrod
#dbdfb9palegoldenrod
Primary foreground
#424620darkolivegreen
#424620darkolivegreen
Secondary
#bdb9dflightsteelblue
#bdb9dflightsteelblue
Secondary foreground
#242046midnightblue
#242046midnightblue
Muted
#d8d7e5gainsboro
#1b1a28black
Muted foreground
#3f3e41darkslategray
#bebec1silver
Accent
#bdb9dflightsteelblue
#bdb9dflightsteelblue
Accent foreground
#242046midnightblue
#242046midnightblue
Destructive
#702700maroon
#ff5900orangered
Destructive foreground
#ffc3a3navajowhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#dbdfb9palegoldenrod
#dbdfb9palegoldenrod

Contrast

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

Light mode
Text on background20.52:1AAA
Text on card20.54:1AAA
Primary button7.16:1AAA
Secondary button8.15:1AAA
Muted text7.45:1AAA
Accent8.15:1AAA
Destructive6.84:1AA
Dark mode
Text on background19.75:1AAA
Text on card19.31:1AAA
Primary button7.16:1AAA
Secondary button8.15:1AAA
Muted text9.24:1AAA
Accent8.15:1AAA
Destructive6.68:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.106 0.018 112.63);
  --muted: oklch(0.883 0.02 290.586);
  --muted-foreground: oklch(0.367 0.004 290.791);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.106 0.018 112.63);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.891 0.05 112.056);
  --primary-foreground: oklch(0.38 0.057 113.846);
  --secondary: oklch(0.802 0.053 289.73);
  --secondary-foreground: oklch(0.27 0.068 285.419);
  --accent: oklch(0.802 0.053 289.73);
  --accent-foreground: oklch(0.27 0.068 285.419);
  --destructive: oklch(0.378 0.113 42.747);
  --destructive-foreground: oklch(0.864 0.081 49.555);
  --ring: oklch(0.891 0.05 112.056);
  --chart-1: oklch(0.891 0.05 112.056);
  --chart-2: oklch(0.802 0.053 289.73);
  --chart-3: oklch(0.802 0.053 289.73);
  --chart-4: oklch(0.832 0.045 289.98);
  --chart-5: oklch(0.894 0.054 112.132);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.146 0.016 112.262);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.226 0.028 288.513);
  --muted-foreground: oklch(0.802 0.004 290.93);
  --popover: oklch(0.146 0.016 112.262);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.163 0.019 112.819);
  --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.891 0.05 112.056);
  --primary-foreground: oklch(0.38 0.057 113.846);
  --secondary: oklch(0.802 0.053 289.73);
  --secondary-foreground: oklch(0.27 0.068 285.419);
  --accent: oklch(0.802 0.053 289.73);
  --accent-foreground: oklch(0.27 0.068 285.419);
  --destructive: oklch(0.681 0.214 39.866);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.891 0.05 112.056);
  --chart-1: oklch(0.891 0.05 112.056);
  --chart-2: oklch(0.802 0.053 289.73);
  --chart-3: oklch(0.802 0.053 289.73);
  --chart-4: oklch(0.832 0.045 289.98);
  --chart-5: oklch(0.894 0.054 112.132);
}