Charming for shadcn/ui

Charming is a shadcn/ui theme built around a purple primary color (#a81f8f) with cyan accents (#1f8fa8). The light mode uses a neutral background (#ffffff). Dark mode keeps the purple primary (#a81f8f) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#ffffffwhite
#000000black
Foreground
#150512black
#fdfcfdwhite
Card
#fcfcfcsnow
#030303black
Card foreground
#11040eblack
#ffffffwhite
Popover
#ffffffwhite
#000000black
Popover foreground
#150512black
#fdfcfdwhite
Primary
#a81f8fmediumvioletred
#a81f8fmediumvioletred
Primary foreground
#fefbfewhite
#fefbfewhite
Secondary
#8fa81fyellowgreen
#8fa81fyellowgreen
Secondary foreground
#000000black
#000000black
Muted
#dadbd6gainsboro
#282924darkslategray
Muted foreground
#5e5f59dimgray
#a5a6a0darkgray
Accent
#1f8fa8lightseagreen
#1f8fa8lightseagreen
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#bf3008firebrick
#f7643btomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#a81f8fmediumvioletred
#a81f8fmediumvioletred

Contrast

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

Light mode
Text on background19.76:1AAA
Text on card19.61:1AAA
Primary button6.27:1AA
Secondary button7.79:1AAA
Muted text4.64:1AA
Accent3.78:1AA Large
Destructive5.77:1AA
Dark mode
Text on background20.51:1AAA
Text on card20.67:1AAA
Primary button6.27:1AA
Secondary button7.79:1AAA
Muted text5.98:1AA
Accent3.78:1AA Large
Destructive6.82:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.15 0.041 334.364);
  --muted: oklch(0.89 0.007 114.975);
  --muted-foreground: oklch(0.481 0.009 115.159);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.15 0.041 334.364);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.136 0.036 333.798);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.51 0.204 337.176);
  --primary-foreground: oklch(0.991 0.005 331.483);
  --secondary: oklch(0.689 0.155 120.215);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.602 0.1 217.403);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.53 0.185 34.19);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.51 0.204 337.176);
  --chart-1: oklch(0.51 0.204 337.176);
  --chart-2: oklch(0.689 0.155 120.215);
  --chart-3: oklch(0.602 0.1 217.403);
  --chart-4: oklch(0.728 0.164 120.252);
  --chart-5: oklch(0.515 0.209 337.375);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.992 0.001 331.425);
  --muted: oklch(0.278 0.01 115.468);
  --muted-foreground: oklch(0.723 0.008 115.026);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(0.992 0.001 331.425);
  --card: oklch(0.092 0 180);
  --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.51 0.204 337.176);
  --primary-foreground: oklch(0.991 0.005 331.483);
  --secondary: oklch(0.689 0.155 120.215);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.602 0.1 217.403);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.684 0.189 36.149);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.51 0.204 337.176);
  --chart-1: oklch(0.51 0.204 337.176);
  --chart-2: oklch(0.689 0.155 120.215);
  --chart-3: oklch(0.602 0.1 217.403);
  --chart-4: oklch(0.728 0.164 120.252);
  --chart-5: oklch(0.515 0.209 337.375);
}