Violet for shadcn/ui

Violet is a shadcn/ui theme built around a muted yellow primary color (#5f6142) with muted indigo accents (#444261). The light mode uses a neutral background (#fbfcf8). Dark mode keeps the muted yellow primary (#5f6142) on a yellow-tinted background (#0d0e07).

Color palette

TokenLightDark
Background
#fbfcf8snow
#0d0e07black
Foreground
#040401black
#ffffffwhite
Card
#fafaf5whitesmoke
#111108black
Card foreground
#000000black
#ffffffwhite
Popover
#fafaf5whitesmoke
#111108black
Popover foreground
#000000black
#ffffffwhite
Primary
#5f6142darkolivegreen
#5f6142darkolivegreen
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#444261darkslategray
#444261darkslategray
Secondary foreground
#e7e7eelavender
#e7e7eelavender
Muted
#e6e5f0lavender
#0f0f1ablack
Muted foreground
#4c4b53darkslategray
#adacb4darkgray
Accent
#444261darkslategray
#444261darkslategray
Accent foreground
#e7e7eelavender
#e7e7eelavender
Destructive
#b93e09firebrick
#f4510borangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#5f6142darkolivegreen
#5f6142darkolivegreen

Contrast

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

Light mode
Text on background19.90:1AAA
Text on card20.04:1AAA
Primary button6.40:1AA
Secondary button7.75:1AAA
Muted text6.89:1AA
Accent7.75:1AAA
Destructive5.60:1AA
Dark mode
Text on background19.39:1AAA
Text on card18.93:1AAA
Primary button6.40:1AA
Secondary button7.75:1AAA
Muted text8.46:1AAA
Accent7.75:1AAA
Destructive3.49:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.005 109.567);
  --foreground: oklch(0.106 0.017 111.371);
  --muted: oklch(0.925 0.015 289.165);
  --muted-foreground: oklch(0.417 0.013 288.884);
  --popover: oklch(0.983 0.007 109.612);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.983 0.007 109.612);
  --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.483 0.047 111.229);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.395 0.052 286.813);
  --secondary-foreground: oklch(0.93 0.01 289.268);
  --accent: oklch(0.395 0.052 286.813);
  --accent-foreground: oklch(0.93 0.01 289.268);
  --destructive: oklch(0.534 0.168 38.644);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.483 0.047 111.229);
  --chart-1: oklch(0.483 0.047 111.229);
  --chart-2: oklch(0.395 0.052 286.813);
  --chart-3: oklch(0.395 0.052 286.813);
  --chart-4: oklch(0.42 0.056 286.772);
  --chart-5: oklch(0.49 0.053 111.445);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.16 0.015 111.05);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.174 0.023 286.737);
  --muted-foreground: oklch(0.747 0.011 289.195);
  --popover: oklch(0.175 0.018 111.292);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.175 0.018 111.292);
  --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.483 0.047 111.229);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.395 0.052 286.813);
  --secondary-foreground: oklch(0.93 0.01 289.268);
  --accent: oklch(0.395 0.052 286.813);
  --accent-foreground: oklch(0.93 0.01 289.268);
  --destructive: oklch(0.653 0.209 38.2);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.483 0.047 111.229);
  --chart-1: oklch(0.483 0.047 111.229);
  --chart-2: oklch(0.395 0.052 286.813);
  --chart-3: oklch(0.395 0.052 286.813);
  --chart-4: oklch(0.42 0.056 286.772);
  --chart-5: oklch(0.49 0.053 111.445);
}