This for shadcn/ui

This is a shadcn/ui theme built around a violet primary color (#7328c3) with neutral gray accents (#d6d5d7). The light mode uses a neutral background (#fcfcfd). Dark mode keeps the violet primary (#7328c3) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fcfcfdwhite
#000000black
Foreground
#000000black
#f7f5fawhitesmoke
Card
#faf8fcghostwhite
#030303black
Card foreground
#000000black
#faf8fbghostwhite
Popover
#faf8fcghostwhite
#030303black
Popover foreground
#000000black
#faf8fbghostwhite
Primary
#7328c3blueviolet
#7328c3blueviolet
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#d6d5d7lightgrey
#333135darkslategray
Secondary foreground
#3d3c3edarkslategray
#cccacelightgrey
Muted
#dedce0gainsboro
#211f23black
Muted foreground
#424045darkslategray
#bdbabfsilver
Accent
#d6d5d7lightgrey
#333135darkslategray
Accent foreground
#3d3c3edarkslategray
#cccacelightgrey
Destructive
#811403maroon
#fa4e33tomato
Destructive foreground
#fdc2b9lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#7328c3blueviolet
#7328c3blueviolet

Contrast

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

Light mode
Text on background20.44:1AAA
Text on card19.89:1AAA
Primary button7.46:1AAA
Secondary button7.52:1AAA
Muted text7.52:1AAA
Accent7.52:1AAA
Destructive6.66:1AA
Dark mode
Text on background19.39:1AAA
Text on card19.58:1AAA
Primary button7.46:1AAA
Secondary button7.91:1AAA
Muted text8.47:1AAA
Accent7.91:1AAA
Destructive3.39:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 307.759);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.897 0.005 307.727);
  --muted-foreground: oklch(0.375 0.01 307.492);
  --popover: oklch(0.982 0.005 307.727);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.982 0.005 307.727);
  --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.477 0.22 299.578);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.875 0.002 307.757);
  --secondary-foreground: oklch(0.358 0.004 307.644);
  --accent: oklch(0.875 0.002 307.757);
  --accent-foreground: oklch(0.358 0.004 307.644);
  --destructive: oklch(0.39 0.145 31.677);
  --destructive-foreground: oklch(0.866 0.069 28.553);
  --ring: oklch(0.477 0.22 299.578);
  --chart-1: oklch(0.477 0.22 299.578);
  --chart-2: oklch(0.875 0.002 307.757);
  --chart-3: oklch(0.875 0.002 307.757);
  --chart-4: oklch(0.899 0.002 307.764);
  --chart-5: oklch(0.477 0.226 299.008);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.973 0.006 307.711);
  --muted: oklch(0.244 0.007 307.473);
  --muted-foreground: oklch(0.793 0.008 307.673);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(0.982 0.004 307.738);
  --card: oklch(0.092 0 180);
  --card-foreground: oklch(0.982 0.004 307.738);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.477 0.22 299.578);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.317 0.008 307.507);
  --secondary-foreground: oklch(0.842 0.006 307.706);
  --accent: oklch(0.317 0.008 307.507);
  --accent-foreground: oklch(0.842 0.006 307.706);
  --destructive: oklch(0.662 0.213 31.602);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.477 0.22 299.578);
  --chart-1: oklch(0.477 0.22 299.578);
  --chart-2: oklch(0.317 0.008 307.507);
  --chart-3: oklch(0.317 0.008 307.507);
  --chart-4: oklch(0.346 0.009 307.499);
  --chart-5: oklch(0.477 0.226 299.008);
}