Ethical for shadcn/ui

Ethical is a shadcn/ui theme built around a green primary color (#a6c95e) with violet accents (#825ec9). The light mode uses a neutral background (#fbfdf7). Dark mode keeps the green primary (#a6c95e) on a neutral background (#030401).

Color palette

TokenLightDark
Background
#fbfdf7snow
#030401black
Foreground
#0c1004black
#ffffffwhite
Card
#f9fbf3floralwhite
#060803black
Card foreground
#090c03black
#ffffffwhite
Popover
#fbfdf7snow
#030401black
Popover foreground
#0c1004black
#ffffffwhite
Primary
#a6c95edarkkhaki
#a6c95edarkkhaki
Primary foreground
#000000black
#000000black
Secondary
#825ec9slateblue
#825ec9slateblue
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#efeef1whitesmoke
#0f0e11black
Muted foreground
#535158dimgray
#aaa7aedarkgray
Accent
#825ec9slateblue
#825ec9slateblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#983706saddlebrown
#f55f14orangered
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#a6c95edarkkhaki
#a6c95edarkkhaki

Contrast

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

Light mode
Text on background18.71:1AAA
Text on card18.90:1AAA
Primary button11.17:1AAA
Secondary button4.76:1AA
Muted text6.78:1AA
Accent4.76:1AA
Destructive7.30:1AAA
Dark mode
Text on background20.57:1AAA
Text on card20.16:1AAA
Primary button11.17:1AAA
Secondary button4.76:1AA
Muted text8.10:1AAA
Accent4.76:1AA
Destructive6.53:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.007 121.608);
  --foreground: oklch(0.165 0.026 122.861);
  --muted: oklch(0.952 0.003 301.436);
  --muted-foreground: oklch(0.439 0.011 301.08);
  --popover: oklch(0.99 0.007 121.608);
  --popover-foreground: oklch(0.165 0.026 122.861);
  --card: oklch(0.985 0.011 121.666);
  --card-foreground: oklch(0.147 0.022 121.473);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.788 0.141 124.843);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.57 0.16 296.333);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.57 0.16 296.333);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.469 0.14 41.13);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.788 0.141 124.843);
  --chart-1: oklch(0.788 0.141 124.843);
  --chart-2: oklch(0.57 0.16 296.333);
  --chart-3: oklch(0.57 0.16 296.333);
  --chart-4: oklch(0.601 0.149 297.083);
  --chart-5: oklch(0.796 0.148 125.026);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.1 0.013 121.199);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.166 0.005 300.988);
  --muted-foreground: oklch(0.734 0.01 301.276);
  --popover: oklch(0.1 0.013 121.199);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.127 0.016 121.199);
  --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.788 0.141 124.843);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.57 0.16 296.333);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.57 0.16 296.333);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.673 0.199 41.327);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.788 0.141 124.843);
  --chart-1: oklch(0.788 0.141 124.843);
  --chart-2: oklch(0.57 0.16 296.333);
  --chart-3: oklch(0.57 0.16 296.333);
  --chart-4: oklch(0.601 0.149 297.083);
  --chart-5: oklch(0.796 0.148 125.026);
}