Conventional for shadcn/ui

Conventional is a shadcn/ui theme built around a near-white primary color (#fffffa) with muted light yellow accents (#d3d4c4). The light mode uses a neutral background (#fcfdf7). Dark mode keeps the near-white primary (#fffffa) on a neutral background (#030402).

Color palette

TokenLightDark
Background
#fcfdf7snow
#030402black
Foreground
#090901black
#f9faf5whitesmoke
Card
#fbfcf3floralwhite
#070703black
Card foreground
#040501black
#fbfcf8snow
Popover
#fbfcf3floralwhite
#070703black
Popover foreground
#040501black
#fbfcf8snow
Primary
#fffffawhite
#fffffawhite
Primary foreground
#5a6000darkolivegreen
#5a6000darkolivegreen
Secondary
#dedfd8gainsboro
#29291edarkslategray
Secondary foreground
#47483cdarkslategray
#c6c7b2silver
Muted
#e8e9d8antiquewhite
#262716black
Muted foreground
#6e6f58dimgray
#a6a790darkgray
Accent
#d3d4c4lightgrey
#404229darkslategray
Accent foreground
#3a3b2bdarkslategray
#d8dac3lightgrey
Destructive
#691907maroon
#f1441eorangered
Destructive foreground
#f9b8a9lightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fffffawhite
#fffffawhite

Contrast

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

Light mode
Text on background19.52:1AAA
Text on card19.74:1AAA
Primary button6.73:1AA
Secondary button6.90:1AA
Muted text4.17:1AA Large
Accent7.57:1AAA
Destructive7.13:1AAA
Dark mode
Text on background19.61:1AAA
Text on card19.57:1AAA
Primary button6.73:1AA
Secondary button8.51:1AAA
Muted text6.18:1AA
Accent7.26:1AAA
Destructive3.76:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.992 0.008 109.622);
  --foreground: oklch(0.135 0.024 111.552);
  --muted: oklch(0.928 0.022 109.917);
  --muted-foreground: oklch(0.535 0.036 110.695);
  --popover: oklch(0.987 0.011 109.694);
  --popover-foreground: oklch(0.107 0.019 111.552);
  --card: oklch(0.987 0.011 109.694);
  --card-foreground: oklch(0.107 0.019 111.552);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.998 0.007 109.602);
  --primary-foreground: oklch(0.469 0.105 114.201);
  --secondary: oklch(0.9 0.009 109.657);
  --secondary-foreground: oklch(0.398 0.019 110.372);
  --accent: oklch(0.864 0.021 109.922);
  --accent-foreground: oklch(0.345 0.025 110.819);
  --destructive: oklch(0.348 0.117 33.751);
  --destructive-foreground: oklch(0.838 0.08 33.002);
  --ring: oklch(0.998 0.007 109.602);
  --chart-1: oklch(0.998 0.007 109.602);
  --chart-2: oklch(0.9 0.009 109.657);
  --chart-3: oklch(0.864 0.021 109.922);
  --chart-4: oklch(0.922 0.007 109.615);
  --chart-5: oklch(0.998 0.007 109.606);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.101 0.01 110.727);
  --foreground: oklch(0.983 0.006 109.601);
  --muted: oklch(0.266 0.029 111.424);
  --muted-foreground: oklch(0.722 0.034 110.329);
  --popover: oklch(0.127 0.013 110.727);
  --popover-foreground: oklch(0.989 0.004 109.559);
  --card: oklch(0.127 0.013 110.727);
  --card-foreground: oklch(0.989 0.004 109.559);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.998 0.007 109.602);
  --primary-foreground: oklch(0.469 0.105 114.201);
  --secondary: oklch(0.278 0.02 110.792);
  --secondary-foreground: oklch(0.824 0.029 110.125);
  --accent: oklch(0.37 0.039 111.4);
  --accent-foreground: oklch(0.88 0.03 110.104);
  --destructive: oklch(0.636 0.214 33.621);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.998 0.007 109.602);
  --chart-1: oklch(0.998 0.007 109.602);
  --chart-2: oklch(0.278 0.02 110.792);
  --chart-3: oklch(0.37 0.039 111.4);
  --chart-4: oklch(0.313 0.024 110.851);
  --chart-5: oklch(0.998 0.007 109.606);
}