Precedence for shadcn/ui

Precedence is a shadcn/ui theme built around a violet primary color (#754da3) with green accents (#4da375). The light mode uses a neutral background (#fcfbfe). Dark mode keeps the violet primary (#754da3) on a neutral background (#050208).

Color palette

TokenLightDark
Background
#fcfbfewhite
#050208black
Foreground
#0a0312black
#ffffffwhite
Card
#faf6fdghostwhite
#07040cblack
Card foreground
#07020dblack
#ffffffwhite
Popover
#fcfbfewhite
#050208black
Popover foreground
#0a0312black
#ffffffwhite
Primary
#754da3rebeccapurple
#754da3rebeccapurple
Primary foreground
#ffffffwhite
#ffffffwhite
Secondary
#a3754dperu
#a3754dperu
Secondary foreground
#ffffffwhite
#ffffffwhite
Muted
#e9e3ddgainsboro
#221c16black
Muted foreground
#5e5955dimgray
#aaa5a1darkgray
Accent
#4da375mediumseagreen
#4da375mediumseagreen
Accent foreground
#000000black
#000000black
Destructive
#b63802firebrick
#fd550dorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#754da3rebeccapurple
#754da3rebeccapurple

Contrast

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

Light mode
Text on background19.66:1AAA
Text on card19.26:1AAA
Primary button6.29:1AA
Secondary button4.03:1AA Large
Muted text5.41:1AA
Accent6.80:1AA
Destructive5.92:1AA
Dark mode
Text on background20.58:1AAA
Text on card20.37:1AAA
Primary button6.29:1AA
Secondary button4.03:1AA Large
Muted text6.92:1AA
Accent6.80:1AA
Destructive3.25:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.989 0.005 307.052);
  --foreground: oklch(0.122 0.041 306.838);
  --muted: oklch(0.918 0.011 63.943);
  --muted-foreground: oklch(0.467 0.009 63.84);
  --popover: oklch(0.989 0.005 307.052);
  --popover-foreground: oklch(0.122 0.041 306.838);
  --card: oklch(0.979 0.01 306.991);
  --card-foreground: oklch(0.11 0.036 308.624);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.503 0.137 303.406);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.6 0.08 61.556);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.649 0.109 157.936);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.522 0.17 37.868);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.503 0.137 303.406);
  --chart-1: oklch(0.503 0.137 303.406);
  --chart-2: oklch(0.6 0.08 61.556);
  --chart-3: oklch(0.649 0.109 157.936);
  --chart-4: oklch(0.627 0.084 61.532);
  --chart-5: oklch(0.5 0.147 303.001);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.103 0.02 308.423);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.231 0.015 63.174);
  --muted-foreground: oklch(0.726 0.008 63.947);
  --popover: oklch(0.103 0.02 308.423);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.118 0.023 308.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.503 0.137 303.406);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.6 0.08 61.556);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.649 0.109 157.936);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.672 0.215 38.23);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.503 0.137 303.406);
  --chart-1: oklch(0.503 0.137 303.406);
  --chart-2: oklch(0.6 0.08 61.556);
  --chart-3: oklch(0.649 0.109 157.936);
  --chart-4: oklch(0.627 0.084 61.532);
  --chart-5: oklch(0.5 0.147 303.001);
}