w for shadcn/ui

w is a shadcn/ui theme built around a vivid violet primary color (#4310a2) with muted light violet accents (#beb4d0). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid violet primary (#4310a2) on a violet-tinted background (#221f26).

Color palette

TokenLightDark
Background
#ffffffwhite
#221f26black
Foreground
#040209black
#f9f8fcghostwhite
Card
#fcfcfcsnow
#121014black
Card foreground
#020104black
#fcfbfdsnow
Popover
#fcfcfcsnow
#121014black
Popover foreground
#020104black
#fcfbfdsnow
Primary
#4310a2indigo
#4310a2indigo
Primary foreground
#efe8fdlavender
#efe8fdlavender
Secondary
#d7d3dfgainsboro
#28282adarkslategray
Secondary foreground
#3d364adarkslategray
#c1c0c4silver
Muted
#ddd5ecgainsboro
#1b132ablack
Muted foreground
#504e56darkslategray
#aca9b1darkgray
Accent
#beb4d0silver
#317256seagreen
Accent foreground
#261f32darkslategray
#e7e5e9lavender
Destructive
#a62a07firebrick
#d83554crimson
Destructive foreground
#fee8e2mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#4310a2indigo
#4310a2indigo

Contrast

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

Light mode
Text on background20.63:1AAA
Text on card20.37:1AAA
Primary button9.58:1AAA
Secondary button7.79:1AAA
Muted text5.76:1AA
Accent7.99:1AAA
Destructive6.03:1AA
Dark mode
Text on background15.37:1AAA
Text on card18.30:1AAA
Primary button9.58:1AAA
Secondary button8.15:1AAA
Muted text7.72:1AAA
Accent4.58:1AA
Destructive4.61:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.095 0.028 303.154);
  --muted: oklch(0.886 0.033 301.634);
  --muted-foreground: oklch(0.428 0.014 301.709);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0.076 0.022 303.154);
  --card: oklch(0.992 0 161.565);
  --card-foreground: oklch(0.076 0.022 303.154);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.373 0.202 287.169);
  --primary-foreground: oklch(0.942 0.029 301.731);
  --secondary: oklch(0.873 0.017 301.903);
  --secondary-foreground: oklch(0.347 0.036 300.556);
  --accent: oklch(0.786 0.041 301.398);
  --accent-foreground: oklch(0.257 0.036 299.977);
  --destructive: oklch(0.48 0.166 34.379);
  --destructive-foreground: oklch(0.946 0.026 35.95);
  --ring: oklch(0.373 0.202 287.169);
  --chart-1: oklch(0.373 0.202 287.169);
  --chart-2: oklch(0.873 0.017 301.903);
  --chart-3: oklch(0.786 0.041 301.398);
  --chart-4: oklch(0.899 0.014 301.974);
  --chart-5: oklch(0.374 0.206 286.356);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.246 0.014 304.784);
  --foreground: oklch(0.981 0.006 302.124);
  --muted: oklch(0.21 0.046 298.525);
  --muted-foreground: oklch(0.741 0.012 301.959);
  --popover: oklch(0.177 0.009 307.917);
  --popover-foreground: oklch(0.99 0.003 302.169);
  --card: oklch(0.178 0.007 305.025);
  --card-foreground: oklch(0.99 0.003 302.169);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.373 0.202 287.169);
  --primary-foreground: oklch(0.942 0.029 301.731);
  --secondary: oklch(0.277 0.005 301.953);
  --secondary-foreground: oklch(0.81 0.005 302.111);
  --accent: oklch(0.501 0.081 162.705);
  --accent-foreground: oklch(0.925 0.006 302.117);
  --destructive: oklch(0.587 0.198 15.576);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.373 0.202 287.169);
  --chart-1: oklch(0.373 0.202 287.169);
  --chart-2: oklch(0.277 0.005 301.953);
  --chart-3: oklch(0.501 0.081 162.705);
  --chart-4: oklch(0.307 0.005 301.942);
  --chart-5: oklch(0.374 0.206 286.356);
}