Sunlight for shadcn/ui

Sunlight is a shadcn/ui theme built around a muted light purple primary color (#f0e6ee) with muted light purple accents (#e9dde7). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted light purple primary (#f0e6ee) on a neutral background (#070306).

Color palette

TokenLightDark
Background
#ffffffwhite
#070306black
Foreground
#000000black
#fbf9fbsnow
Card
#ffffffwhite
#070306black
Card foreground
#000000black
#fbf9fbsnow
Popover
#ffffffwhite
#070306black
Popover foreground
#000000black
#fbf9fbsnow
Primary
#f0e6eelavender
#f0e6eelavender
Primary foreground
#663d60dimgray
#663d60dimgray
Secondary
#e9dde7gainsboro
#261c25black
Secondary foreground
#593b54darkslategray
#c5afc2silver
Muted
#f6eef5whitesmoke
#110910black
Muted foreground
#5b4d59dimgray
#b2a4b0darkgray
Accent
#e9dde7gainsboro
#261c25black
Accent foreground
#593b54darkslategray
#c5afc2silver
Destructive
#692302maroon
#fb6018orangered
Destructive foreground
#febda0lightpink
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#f0e6eelavender
#f0e6eelavender

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card21.00:1AAA
Primary button7.16:1AAA
Secondary button7.33:1AAA
Muted text6.97:1AA
Accent7.33:1AAA
Destructive7.05:1AAA
Dark mode
Text on background19.54:1AAA
Text on card19.54:1AAA
Primary button7.16:1AAA
Secondary button8.06:1AAA
Muted text8.26:1AAA
Accent8.06:1AAA
Destructive6.80:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.958 0.013 330.421);
  --muted-foreground: oklch(0.439 0.025 330.97);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(1 0 180);
  --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.934 0.016 330.465);
  --primary-foreground: oklch(0.422 0.076 332.405);
  --secondary: oklch(0.91 0.018 330.494);
  --secondary-foreground: oklch(0.396 0.057 331.974);
  --accent: oklch(0.91 0.018 330.494);
  --accent-foreground: oklch(0.396 0.057 331.974);
  --destructive: oklch(0.359 0.109 40.887);
  --destructive-foreground: oklch(0.851 0.085 45.943);
  --ring: oklch(0.934 0.016 330.465);
  --chart-1: oklch(0.934 0.016 330.465);
  --chart-2: oklch(0.91 0.018 330.494);
  --chart-3: oklch(0.91 0.018 330.494);
  --chart-4: oklch(0.935 0.013 330.421);
  --chart-5: oklch(0.933 0.018 330.491);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.111 0.016 330.982);
  --foreground: oklch(0.984 0.003 330.281);
  --muted: oklch(0.153 0.021 331.836);
  --muted-foreground: oklch(0.734 0.022 330.633);
  --popover: oklch(0.111 0.016 330.982);
  --popover-foreground: oklch(0.984 0.003 330.281);
  --card: oklch(0.111 0.016 330.982);
  --card-foreground: oklch(0.984 0.003 330.281);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.934 0.016 330.465);
  --primary-foreground: oklch(0.422 0.076 332.405);
  --secondary: oklch(0.242 0.023 331.421);
  --secondary-foreground: oklch(0.779 0.036 330.829);
  --accent: oklch(0.242 0.023 331.421);
  --accent-foreground: oklch(0.779 0.036 330.829);
  --destructive: oklch(0.684 0.204 40.511);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.934 0.016 330.465);
  --chart-1: oklch(0.934 0.016 330.465);
  --chart-2: oklch(0.242 0.023 331.421);
  --chart-3: oklch(0.242 0.023 331.421);
  --chart-4: oklch(0.273 0.028 331.488);
  --chart-5: oklch(0.933 0.018 330.491);
}