Nanoparticle for shadcn/ui

Nanoparticle is a shadcn/ui theme built around a yellow primary color (#debc5e) with violet accents (#bc5ede). The light mode uses a neutral background (#fdfbf7). Dark mode keeps the yellow primary (#debc5e) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fdfbf7snow
#000000black
Foreground
#0f0d05black
#ffffffwhite
Card
#fdfbf7snow
#000000black
Card foreground
#0f0d05black
#ffffffwhite
Popover
#fdfbf7snow
#000000black
Popover foreground
#0f0d05black
#ffffffwhite
Primary
#debc5esandybrown
#debc5esandybrown
Primary foreground
#080702black
#080702black
Secondary
#5edebcmediumaquamarine
#5edebcmediumaquamarine
Secondary foreground
#020807black
#020807black
Muted
#dae7e3gainsboro
#182521black
Muted foreground
#4a645ddimgray
#9bb5aedarkgray
Accent
#bc5edemediumorchid
#bc5edemediumorchid
Accent foreground
#000000black
#000000black
Destructive
#8d1b07darkred
#f44425orangered
Destructive foreground
#fcd1capink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#debc5esandybrown
#debc5esandybrown

Contrast

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

Light mode
Text on background18.85:1AAA
Text on card18.85:1AAA
Primary button11.00:1AAA
Secondary button12.16:1AAA
Muted text5.03:1AA
Accent5.79:1AA
Destructive6.60:1AA
Dark mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button11.00:1AAA
Secondary button12.16:1AAA
Muted text7.26:1AAA
Accent5.79:1AA
Destructive3.69:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.006 90.169);
  --foreground: oklch(0.158 0.017 92.328);
  --muted: oklch(0.916 0.014 178.346);
  --muted-foreground: oklch(0.479 0.033 176.626);
  --popover: oklch(0.989 0.006 90.169);
  --popover-foreground: oklch(0.158 0.017 92.328);
  --card: oklch(0.989 0.006 90.169);
  --card-foreground: oklch(0.158 0.017 92.328);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.806 0.12 89.568);
  --primary-foreground: oklch(0.126 0.018 96.007);
  --secondary: oklch(0.82 0.124 172.76);
  --secondary-foreground: oklch(0.126 0.017 178.897);
  --accent: oklch(0.646 0.201 316.123);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.418 0.151 32.072);
  --destructive-foreground: oklch(0.896 0.05 29.767);
  --ring: oklch(0.806 0.12 89.568);
  --chart-1: oklch(0.806 0.12 89.568);
  --chart-2: oklch(0.82 0.124 172.76);
  --chart-3: oklch(0.646 0.201 316.123);
  --chart-4: oklch(0.832 0.117 173.448);
  --chart-5: oklch(0.811 0.124 89.436);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.251 0.018 176.495);
  --muted-foreground: oklch(0.752 0.03 177.579);
  --popover: oklch(0 0 0);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0 0 0);
  --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.806 0.12 89.568);
  --primary-foreground: oklch(0.126 0.018 96.007);
  --secondary: oklch(0.82 0.124 172.76);
  --secondary-foreground: oklch(0.126 0.017 178.897);
  --accent: oklch(0.646 0.201 316.123);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.641 0.216 32.335);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.806 0.12 89.568);
  --chart-1: oklch(0.806 0.12 89.568);
  --chart-2: oklch(0.82 0.124 172.76);
  --chart-3: oklch(0.646 0.201 316.123);
  --chart-4: oklch(0.832 0.117 173.448);
  --chart-5: oklch(0.811 0.124 89.436);
}