Rite for shadcn/ui

Rite is a shadcn/ui theme built around a muted violet primary color (#6f5aa0) with muted green accents (#8ba05a). The light mode uses a neutral background (#f9f7fd). Dark mode keeps the muted violet primary (#6f5aa0) on a neutral background (#020104).

Color palette

TokenLightDark
Background
#f9f7fdghostwhite
#020104black
Foreground
#070312black
#fcfcfdwhite
Card
#f6f3fbwhitesmoke
#040208black
Card foreground
#05020dblack
#ffffffwhite
Popover
#f9f7fdghostwhite
#020104black
Popover foreground
#070312black
#fcfcfdwhite
Primary
#6f5aa0rebeccapurple
#6f5aa0rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#8ba05agray
#8ba05agray
Secondary foreground
#000000black
#000000black
Muted
#e6ebdbgainsboro
#1f2414black
Muted foreground
#62635fdimgray
#9fa09cdarkgray
Accent
#8ba05agray
#8ba05agray
Accent foreground
#000000black
#000000black
Destructive
#98230bbrown
#ef4625orangered
Destructive foreground
#fcdfd9mistyrose
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#6f5aa0rebeccapurple
#6f5aa0rebeccapurple

Contrast

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

Light mode
Text on background19.16:1AAA
Text on card18.76:1AAA
Primary button5.76:1AA
Secondary button7.26:1AAA
Muted text4.99:1AA
Accent7.26:1AAA
Destructive6.48:1AA
Dark mode
Text on background20.28:1AAA
Text on card20.60:1AAA
Primary button5.76:1AA
Secondary button7.26:1AAA
Muted text6.01:1AA
Accent7.26:1AAA
Destructive3.77:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.979 0.007 299.91);
  --foreground: oklch(0.118 0.039 298.416);
  --muted: oklch(0.933 0.023 120.454);
  --muted-foreground: oklch(0.497 0.006 120.249);
  --popover: oklch(0.979 0.007 299.91);
  --popover-foreground: oklch(0.118 0.039 298.416);
  --card: oklch(0.969 0.011 299.843);
  --card-foreground: oklch(0.106 0.034 299.886);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.519 0.109 296.206);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.673 0.098 122.706);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.673 0.098 122.706);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.447 0.156 32.767);
  --destructive-foreground: oklch(0.926 0.033 31.153);
  --ring: oklch(0.519 0.109 296.206);
  --chart-1: oklch(0.519 0.109 296.206);
  --chart-2: oklch(0.673 0.098 122.706);
  --chart-3: oklch(0.673 0.098 122.706);
  --chart-4: oklch(0.696 0.096 122.534);
  --chart-5: oklch(0.513 0.121 295.679);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.08 0.016 300.237);
  --foreground: oklch(0.991 0.001 300.016);
  --muted: oklch(0.252 0.031 122.206);
  --muted-foreground: oklch(0.704 0.006 120.174);
  --popover: oklch(0.08 0.016 300.237);
  --popover-foreground: oklch(0.991 0.001 300.016);
  --card: oklch(0.101 0.02 300.237);
  --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.519 0.109 296.206);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.673 0.098 122.706);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.673 0.098 122.706);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.635 0.21 33.073);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.519 0.109 296.206);
  --chart-1: oklch(0.519 0.109 296.206);
  --chart-2: oklch(0.673 0.098 122.706);
  --chart-3: oklch(0.673 0.098 122.706);
  --chart-4: oklch(0.696 0.096 122.534);
  --chart-5: oklch(0.513 0.121 295.679);
}