Altruistic for shadcn/ui

Altruistic is a shadcn/ui theme built around a vivid violet primary color (#9a79fb) with vivid green accents (#79fb9a). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the vivid violet primary (#9a79fb) on a violet-tinted background (#06040c).

Color palette

TokenLightDark
Background
#fcfbfewhite
#06040cblack
Foreground
#06030cblack
#f6f5fawhitesmoke
Card
#f8f7fdghostwhite
#070510black
Card foreground
#040208black
#f9f8fcghostwhite
Popover
#fcfbfewhite
#06040cblack
Popover foreground
#06030cblack
#f6f5fawhitesmoke
Primary
#9a79fbmediumpurple
#9a79fbmediumpurple
Primary foreground
#000000black
#000000black
Secondary
#fb9a79lightsalmon
#fb9a79lightsalmon
Secondary foreground
#401202black
#401202black
Muted
#ebdfdbgainsboro
#241814black
Muted foreground
#66534ddimgray
#b2a099darkgray
Accent
#79fb9alightgreen
#79fb9alightgreen
Accent foreground
#024012darkgreen
#024012darkgreen
Destructive
#a11212firebrick
#d31717firebrick
Destructive foreground
#fce8e8linen
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#9a79fbmediumpurple
#9a79fbmediumpurple

Contrast

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

Light mode
Text on background19.82:1AAA
Text on card19.35:1AAA
Primary button6.51:1AA
Secondary button7.64:1AAA
Muted text5.53:1AA
Accent9.20:1AAA
Destructive6.85:1AA
Dark mode
Text on background18.83:1AAA
Text on card19.13:1AAA
Primary button6.51:1AA
Secondary button7.64:1AAA
Muted text6.88:1AA
Accent9.20:1AAA
Destructive5.36:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.004 297.749);
  --foreground: oklch(0.113 0.025 297.307);
  --muted: oklch(0.912 0.014 39.415);
  --muted-foreground: oklch(0.459 0.027 39.265);
  --popover: oklch(0.989 0.004 297.749);
  --popover-foreground: oklch(0.113 0.025 297.307);
  --card: oklch(0.978 0.009 297.67);
  --card-foreground: oklch(0.098 0.021 297.482);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.668 0.185 292.144);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.778 0.125 39.167);
  --secondary-foreground: oklch(0.256 0.077 39.269);
  --accent: oklch(0.891 0.177 149.691);
  --accent-foreground: oklch(0.325 0.096 146.467);
  --destructive: oklch(0.452 0.175 27.977);
  --destructive-foreground: oklch(0.947 0.022 17.553);
  --ring: oklch(0.668 0.185 292.144);
  --chart-1: oklch(0.668 0.185 292.144);
  --chart-2: oklch(0.778 0.125 39.167);
  --chart-3: oklch(0.891 0.177 149.691);
  --chart-4: oklch(0.801 0.11 39.193);
  --chart-5: oklch(0.665 0.191 291.896);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.114 0.023 297.368);
  --foreground: oklch(0.972 0.007 297.704);
  --muted: oklch(0.223 0.021 39.221);
  --muted-foreground: oklch(0.719 0.024 39.336);
  --popover: oklch(0.114 0.023 297.368);
  --popover-foreground: oklch(0.972 0.007 297.704);
  --card: oklch(0.126 0.027 296.356);
  --card-foreground: oklch(0.981 0.004 297.745);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.668 0.185 292.144);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.778 0.125 39.167);
  --secondary-foreground: oklch(0.256 0.077 39.269);
  --accent: oklch(0.891 0.177 149.691);
  --accent-foreground: oklch(0.325 0.096 146.467);
  --destructive: oklch(0.552 0.216 28.206);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.668 0.185 292.144);
  --chart-1: oklch(0.668 0.185 292.144);
  --chart-2: oklch(0.778 0.125 39.167);
  --chart-3: oklch(0.891 0.177 149.691);
  --chart-4: oklch(0.801 0.11 39.193);
  --chart-5: oklch(0.665 0.191 291.896);
}