Rainbow for shadcn/ui

Rainbow is a shadcn/ui theme built around a red primary color (#b05e71) with neutral gray accents (#d1cccd). The light mode uses a neutral background (#fdf7f8). Dark mode keeps the red primary (#b05e71) on a red-tinted background (#0e0608).

Color palette

TokenLightDark
Background
#fdf7f8snow
#0e0608black
Foreground
#050102black
#f9f6f6whitesmoke
Card
#fcf3f5lavenderblush
#12080ablack
Card foreground
#000000black
#fbf9f9snow
Popover
#fdf7f8snow
#0e0608black
Popover foreground
#050102black
#f9f6f6whitesmoke
Primary
#b05e71indianred
#b05e71indianred
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#d1cccdlightgrey
#221b1dblack
Secondary foreground
#393234darkslategray
#c0afb3silver
Muted
#f3eceelinen
#130c0eblack
Muted foreground
#4e4b4cdarkslategray
#b4b1b2darkgray
Accent
#d1cccdlightgrey
#221b1dblack
Accent foreground
#393234darkslategray
#c0afb3silver
Destructive
#cb2e06firebrick
#f9572ftomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b05e71indianred
#b05e71indianred

Contrast

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

Light mode
Text on background19.59:1AAA
Text on card19.25:1AAA
Primary button4.46:1AA Large
Secondary button7.86:1AAA
Muted text7.43:1AAA
Accent7.86:1AAA
Destructive5.35:1AA
Dark mode
Text on background18.61:1AAA
Text on card18.82:1AAA
Primary button4.46:1AA Large
Secondary button8.06:1AAA
Muted text9.09:1AAA
Accent8.06:1AAA
Destructive6.43:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.981 0.007 1.147);
  --foreground: oklch(0.08 0.021 0.992);
  --muted: oklch(0.95 0.007 1.172);
  --muted-foreground: oklch(0.416 0.004 1.243);
  --popover: oklch(0.981 0.007 1.147);
  --popover-foreground: oklch(0.08 0.021 0.992);
  --card: oklch(0.971 0.01 1.244);
  --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.583 0.107 6.054);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.849 0.007 1.18);
  --secondary-foreground: oklch(0.326 0.01 1.763);
  --accent: oklch(0.849 0.007 1.18);
  --accent-foreground: oklch(0.326 0.01 1.763);
  --destructive: oklch(0.549 0.198 33.297);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.583 0.107 6.054);
  --chart-1: oklch(0.583 0.107 6.054);
  --chart-2: oklch(0.849 0.007 1.18);
  --chart-3: oklch(0.849 0.007 1.18);
  --chart-4: oklch(0.873 0.006 1.139);
  --chart-5: oklch(0.582 0.117 6.574);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.138 0.016 1.946);
  --foreground: oklch(0.975 0.004 1.068);
  --muted: oklch(0.164 0.011 2.853);
  --muted-foreground: oklch(0.763 0.004 1.093);
  --popover: oklch(0.138 0.016 1.946);
  --popover-foreground: oklch(0.975 0.004 1.068);
  --card: oklch(0.149 0.018 3.518);
  --card-foreground: oklch(0.983 0.002 1.031);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.583 0.107 6.054);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.231 0.012 2.367);
  --secondary-foreground: oklch(0.77 0.02 1.691);
  --accent: oklch(0.231 0.012 2.367);
  --accent-foreground: oklch(0.77 0.02 1.691);
  --destructive: oklch(0.67 0.204 34.909);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.583 0.107 6.054);
  --chart-1: oklch(0.583 0.107 6.054);
  --chart-2: oklch(0.231 0.012 2.367);
  --chart-3: oklch(0.231 0.012 2.367);
  --chart-4: oklch(0.262 0.014 2.464);
  --chart-5: oklch(0.582 0.117 6.574);
}