Similar for shadcn/ui

Similar is a shadcn/ui theme built around a vivid deep green primary color (#014c08) with vivid deep purple accents (#4c0144). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep green primary (#014c08) on a neutral background (#020803).

Color palette

TokenLightDark
Background
#ffffffwhite
#020803black
Foreground
#000000black
#fcfdfcwhite
Card
#fcfcfcsnow
#040c05black
Card foreground
#000000black
#ffffffwhite
Popover
#fcfcfcsnow
#040c05black
Popover foreground
#000000black
#ffffffwhite
Primary
#014c08darkgreen
#014c08darkgreen
Primary foreground
#1cfd32limegreen
#1cfd32limegreen
Secondary
#4c0144indigo
#4c0144indigo
Secondary foreground
#fe81f1violet
#fe81f1violet
Muted
#ecdfealavender
#20131eblack
Muted foreground
#675165dimgray
#ae98acdarkgray
Accent
#4c0144indigo
#4c0144indigo
Accent foreground
#fe81f1violet
#fe81f1violet
Destructive
#d93208orangered
#f7542btomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#014c08darkgreen
#014c08darkgreen

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.45:1AAA
Secondary button6.91:1AA
Muted text5.55:1AA
Accent6.91:1AA
Destructive4.78:1AA
Dark mode
Text on background19.84:1AAA
Text on card19.86:1AAA
Primary button7.45:1AAA
Secondary button6.91:1AA
Muted text6.71:1AA
Accent6.91:1AA
Destructive6.27:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.918 0.02 328.828);
  --muted-foreground: oklch(0.464 0.042 329.551);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --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.361 0.117 143.69);
  --primary-foreground: oklch(0.863 0.28 143.358);
  --secondary: oklch(0.287 0.127 333.373);
  --secondary-foreground: oklch(0.78 0.201 331.17);
  --accent: oklch(0.287 0.127 333.373);
  --accent-foreground: oklch(0.78 0.201 331.17);
  --destructive: oklch(0.577 0.207 33.294);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.361 0.117 143.69);
  --chart-1: oklch(0.361 0.117 143.69);
  --chart-2: oklch(0.287 0.127 333.373);
  --chart-3: oklch(0.287 0.127 333.373);
  --chart-4: oklch(0.325 0.144 333.512);
  --chart-5: oklch(0.364 0.12 143.654);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.122 0.02 147.446);
  --foreground: oklch(0.993 0.002 148.574);
  --muted: oklch(0.21 0.028 329.995);
  --muted-foreground: oklch(0.706 0.038 329.171);
  --popover: oklch(0.139 0.023 147.411);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.139 0.023 147.411);
  --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.361 0.117 143.69);
  --primary-foreground: oklch(0.863 0.28 143.358);
  --secondary: oklch(0.287 0.127 333.373);
  --secondary-foreground: oklch(0.78 0.201 331.17);
  --accent: oklch(0.287 0.127 333.373);
  --accent-foreground: oklch(0.78 0.201 331.17);
  --destructive: oklch(0.664 0.206 34.819);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.361 0.117 143.69);
  --chart-1: oklch(0.361 0.117 143.69);
  --chart-2: oklch(0.287 0.127 333.373);
  --chart-3: oklch(0.287 0.127 333.373);
  --chart-4: oklch(0.325 0.144 333.512);
  --chart-5: oklch(0.364 0.12 143.654);
}