Altruistic for shadcn/ui

Altruistic is a shadcn/ui theme built around a muted light blue primary color (#d7dbe5) with muted light green accents (#dbe5d7). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted light blue primary (#d7dbe5) on a neutral background (#020203).

Color palette

TokenLightDark
Background
#ffffffwhite
#020203black
Foreground
#020408black
#f9fafbghostwhite
Card
#fcfcfcsnow
#030407black
Card foreground
#010204black
#fcfcfdwhite
Popover
#fcfcfcsnow
#030407black
Popover foreground
#010204black
#fcfcfdwhite
Primary
#d7dbe5gainsboro
#d7dbe5gainsboro
Primary foreground
#364053darkslategray
#364053darkslategray
Secondary
#e5d7dbgainsboro
#e5d7dbgainsboro
Secondary foreground
#533640darkslategray
#533640darkslategray
Muted
#f7edf0whitesmoke
#12080bblack
Muted foreground
#4b4849darkslategray
#b7b4b5silver
Accent
#dbe5d7gainsboro
#dbe5d7gainsboro
Accent foreground
#405336darkslategray
#405336darkslategray
Destructive
#c5280dfirebrick
#f14122orangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#d7dbe5gainsboro
#d7dbe5gainsboro

Contrast

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

Light mode
Text on background20.51:1AAA
Text on card20.30:1AAA
Primary button7.53:1AAA
Secondary button7.64:1AAA
Muted text7.91:1AAA
Accent6.45:1AA
Destructive5.71:1AA
Dark mode
Text on background19.83:1AAA
Text on card19.95:1AAA
Primary button7.53:1AAA
Secondary button7.64:1AAA
Muted text9.59:1AAA
Accent6.45:1AA
Destructive3.79:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.105 0.016 257.245);
  --muted: oklch(0.956 0.011 355.961);
  --muted-foreground: oklch(0.407 0.004 355.914);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.084 0.012 257.245);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.084 0.012 257.245);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.892 0.014 265.931);
  --primary-foreground: oklch(0.37 0.036 265.3);
  --secondary: oklch(0.891 0.016 356.141);
  --secondary-foreground: oklch(0.371 0.043 358.829);
  --accent: oklch(0.91 0.021 135.529);
  --accent-foreground: oklch(0.418 0.052 136.053);
  --destructive: oklch(0.534 0.195 31.931);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.892 0.014 265.931);
  --chart-1: oklch(0.892 0.014 265.931);
  --chart-2: oklch(0.891 0.016 356.141);
  --chart-3: oklch(0.91 0.021 135.529);
  --chart-4: oklch(0.917 0.012 356.007);
  --chart-5: oklch(0.891 0.016 265.919);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.087 0.007 261.281);
  --foreground: oklch(0.984 0.002 265.999);
  --muted: oklch(0.15 0.019 358.437);
  --muted-foreground: oklch(0.771 0.004 355.75);
  --popover: oklch(0.11 0.009 261.281);
  --popover-foreground: oklch(0.992 0.001 266.003);
  --card: oklch(0.11 0.009 261.281);
  --card-foreground: oklch(0.992 0.001 266.003);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.892 0.014 265.931);
  --primary-foreground: oklch(0.37 0.036 265.3);
  --secondary: oklch(0.891 0.016 356.141);
  --secondary-foreground: oklch(0.371 0.043 358.829);
  --accent: oklch(0.91 0.021 135.529);
  --accent-foreground: oklch(0.418 0.052 136.053);
  --destructive: oklch(0.634 0.216 32.312);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.892 0.014 265.931);
  --chart-1: oklch(0.892 0.014 265.931);
  --chart-2: oklch(0.891 0.016 356.141);
  --chart-3: oklch(0.91 0.021 135.529);
  --chart-4: oklch(0.917 0.012 356.007);
  --chart-5: oklch(0.891 0.016 265.919);
}