Carnation for shadcn/ui

Carnation is a shadcn/ui theme built around an indigo primary color (#4334a2) with green accents (#34a243). The light mode uses a neutral background (#ffffff). Dark mode keeps the indigo primary (#4334a2) on an indigo-tinted background (#07060e).

Color palette

TokenLightDark
Background
#ffffffwhite
#07060eblack
Foreground
#050311black
#f9f8fcghostwhite
Card
#fcfcfcsnow
#090812black
Card foreground
#04020dblack
#fcfcfdwhite
Popover
#fcfcfcsnow
#090812black
Popover foreground
#04020dblack
#fcfcfdwhite
Primary
#4334a2darkslateblue
#4334a2darkslateblue
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a24334sienna
#a24334sienna
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#ecdcdagainsboro
#251513black
Muted foreground
#544c4adarkslategray
#b5acabdarkgray
Accent
#34a243seagreen
#34a243seagreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#da3107orangered
#f8542atomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4334a2darkslateblue
#4334a2darkslateblue

Contrast

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

Light mode
Text on background20.43:1AAA
Text on card20.15:1AAA
Primary button9.29:1AAA
Secondary button6.20:1AA
Muted text6.31:1AA
Accent3.29:1AA Large
Destructive4.75:1AA
Dark mode
Text on background19.03:1AAA
Text on card19.42:1AAA
Primary button9.29:1AAA
Secondary button6.20:1AA
Muted text7.88:1AAA
Accent3.29:1AA Large
Destructive6.29:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.116 0.036 288.426);
  --muted: oklch(0.907 0.018 28.044);
  --muted-foreground: oklch(0.423 0.011 28.088);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.104 0.031 289.336);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.104 0.031 289.336);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.414 0.168 282.225);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.507 0.129 30.875);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.629 0.166 145.426);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.579 0.209 33.212);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.414 0.168 282.225);
  --chart-1: oklch(0.414 0.168 282.225);
  --chart-2: oklch(0.507 0.129 30.875);
  --chart-3: oklch(0.629 0.166 145.426);
  --chart-4: oklch(0.532 0.136 30.899);
  --chart-5: oklch(0.41 0.176 281.304);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.131 0.018 290.833);
  --foreground: oklch(0.981 0.005 292.45);
  --muted: oklch(0.218 0.027 29.058);
  --muted-foreground: oklch(0.752 0.01 28.001);
  --popover: oklch(0.141 0.021 290.006);
  --popover-foreground: oklch(0.99 0.002 292.497);
  --card: oklch(0.141 0.021 290.006);
  --card-foreground: oklch(0.99 0.002 292.497);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.414 0.168 282.225);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.507 0.129 30.875);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.629 0.166 145.426);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.665 0.208 34.782);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.414 0.168 282.225);
  --chart-1: oklch(0.414 0.168 282.225);
  --chart-2: oklch(0.507 0.129 30.875);
  --chart-3: oklch(0.629 0.166 145.426);
  --chart-4: oklch(0.532 0.136 30.899);
  --chart-5: oklch(0.41 0.176 281.304);
}