Violet for shadcn/ui

Violet is a shadcn/ui theme built around a muted light violet primary color (#dad2e5) with muted light violet accents (#d3d0d7). The light mode uses a neutral background (#f9f7fd). Dark mode keeps the muted light violet primary (#dad2e5) on a violet-tinted background (#090410).

Color palette

TokenLightDark
Background
#f9f7fdghostwhite
#090410black
Foreground
#090411black
#f7f5f9whitesmoke
Card
#f9f7fdghostwhite
#090410black
Card foreground
#090411black
#f7f5f9whitesmoke
Popover
#f9f7fdghostwhite
#090410black
Popover foreground
#090411black
#f7f5f9whitesmoke
Primary
#dad2e5gainsboro
#dad2e5gainsboro
Primary foreground
#3f3054darkslategray
#3f3054darkslategray
Secondary
#e0dfe1gainsboro
#2d2b31darkslategray
Secondary foreground
#47454adarkslategray
#c6c3cbsilver
Muted
#dfd6ebgainsboro
#1d1429black
Muted foreground
#3e3847darkslategray
#beb8c7silver
Accent
#d3d0d7lightgrey
#463d52darkslategray
Accent foreground
#3a363fdarkslategray
#e0dce5gainsboro
Destructive
#d31609firebrick
#f51e0fred
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#dad2e5gainsboro
#dad2e5gainsboro

Contrast

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

Light mode
Text on background19.07:1AAA
Text on card19.07:1AAA
Primary button8.10:1AAA
Secondary button7.15:1AAA
Muted text8.01:1AAA
Accent7.75:1AAA
Destructive5.41:1AA
Dark mode
Text on background18.67:1AAA
Text on card18.67:1AAA
Primary button8.10:1AAA
Secondary button8.05:1AAA
Muted text9.18:1AAA
Accent7.61:1AAA
Destructive4.13: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.98 0.008 304.939);
  --foreground: oklch(0.125 0.033 304.533);
  --muted: oklch(0.889 0.031 304.571);
  --muted-foreground: oklch(0.354 0.027 303.971);
  --popover: oklch(0.98 0.008 304.939);
  --popover-foreground: oklch(0.125 0.033 304.533);
  --card: oklch(0.98 0.008 304.939);
  --card-foreground: oklch(0.125 0.033 304.533);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.875 0.028 304.61);
  --primary-foreground: oklch(0.344 0.064 302.375);
  --secondary: oklch(0.906 0.003 305.005);
  --secondary-foreground: oklch(0.395 0.007 304.783);
  --accent: oklch(0.862 0.01 304.885);
  --accent-foreground: oklch(0.34 0.017 304.355);
  --destructive: oklch(0.55 0.217 29.76);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.875 0.028 304.61);
  --chart-1: oklch(0.875 0.028 304.61);
  --chart-2: oklch(0.906 0.003 305.005);
  --chart-3: oklch(0.862 0.01 304.885);
  --chart-4: oklch(0.93 0.002 305.016);
  --chart-5: oklch(0.873 0.031 304.56);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.127 0.03 304.553);
  --foreground: oklch(0.974 0.005 304.969);
  --muted: oklch(0.213 0.043 302.129);
  --muted-foreground: oklch(0.791 0.022 304.653);
  --popover: oklch(0.127 0.03 304.553);
  --popover-foreground: oklch(0.974 0.005 304.969);
  --card: oklch(0.127 0.03 304.553);
  --card-foreground: oklch(0.974 0.005 304.969);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.875 0.028 304.61);
  --primary-foreground: oklch(0.344 0.064 302.375);
  --secondary: oklch(0.293 0.012 304.476);
  --secondary-foreground: oklch(0.822 0.011 304.853);
  --accent: oklch(0.377 0.038 303.651);
  --accent-foreground: oklch(0.9 0.013 304.845);
  --destructive: oklch(0.618 0.242 29.755);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.875 0.028 304.61);
  --chart-1: oklch(0.875 0.028 304.61);
  --chart-2: oklch(0.293 0.012 304.476);
  --chart-3: oklch(0.377 0.038 303.651);
  --chart-4: oklch(0.323 0.014 304.456);
  --chart-5: oklch(0.873 0.031 304.56);
}