King for shadcn/ui

King is a shadcn/ui theme built around a vivid light yellow primary color (#fbf28d) with vivid light indigo accents (#8d96fb). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid light yellow primary (#fbf28d) on a neutral background (#080702).

Color palette

TokenLightDark
Background
#ffffffwhite
#080702black
Foreground
#000000black
#f9f9f6whitesmoke
Card
#fcfcfcsnow
#0c0b03black
Card foreground
#000000black
#fbfbf9snow
Popover
#fcfcfcsnow
#0c0b03black
Popover foreground
#000000black
#fbfbf9snow
Primary
#fbf28dkhaki
#fbf28dkhaki
Primary foreground
#544d03darkolivegreen
#544d03darkolivegreen
Secondary
#8d96fbcornflowerblue
#8d96fbcornflowerblue
Secondary foreground
#030954midnightblue
#030954midnightblue
Muted
#e7e7eelavender
#111118black
Muted foreground
#5d5e5fdimgray
#a0a0a2darkgray
Accent
#8d96fbcornflowerblue
#8d96fbcornflowerblue
Accent foreground
#030954midnightblue
#030954midnightblue
Destructive
#cf3f17firebrick
#cf3f17firebrick
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fbf28dkhaki
#fbf28dkhaki

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card20.54:1AAA
Primary button7.47:1AAA
Secondary button6.76:1AA
Muted text5.29:1AA
Accent6.76:1AA
Destructive4.81:1AA
Dark mode
Text on background19.07:1AAA
Text on card19.01:1AAA
Primary button7.47:1AAA
Secondary button6.76:1AA
Muted text7.19:1AAA
Accent6.76:1AA
Destructive4.81:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0 0 0);
  --muted: oklch(0.931 0.01 282.04);
  --muted-foreground: oklch(0.481 0.003 282.117);
  --popover: oklch(0.992 0 161.565);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.992 0 161.565);
  --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.948 0.123 103.922);
  --primary-foreground: oklch(0.415 0.086 103.606);
  --secondary: oklch(0.71 0.147 278.027);
  --secondary-foreground: oklch(0.217 0.129 265.747);
  --accent: oklch(0.71 0.147 278.027);
  --accent-foreground: oklch(0.217 0.129 265.747);
  --destructive: oklch(0.573 0.187 35.15);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.948 0.123 103.922);
  --chart-1: oklch(0.948 0.123 103.922);
  --chart-2: oklch(0.71 0.147 278.027);
  --chart-3: oklch(0.71 0.147 278.027);
  --chart-4: oklch(0.748 0.127 278.896);
  --chart-5: oklch(0.952 0.127 103.946);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.129 0.017 105.202);
  --foreground: oklch(0.981 0.004 102.286);
  --muted: oklch(0.181 0.015 280.762);
  --muted-foreground: oklch(0.706 0.002 282.153);
  --popover: oklch(0.148 0.019 104.921);
  --popover-foreground: oklch(0.987 0.003 102.261);
  --card: oklch(0.148 0.019 104.921);
  --card-foreground: oklch(0.987 0.003 102.261);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.948 0.123 103.922);
  --primary-foreground: oklch(0.415 0.086 103.606);
  --secondary: oklch(0.71 0.147 278.027);
  --secondary-foreground: oklch(0.217 0.129 265.747);
  --accent: oklch(0.71 0.147 278.027);
  --accent-foreground: oklch(0.217 0.129 265.747);
  --destructive: oklch(0.573 0.187 35.15);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.948 0.123 103.922);
  --chart-1: oklch(0.948 0.123 103.922);
  --chart-2: oklch(0.71 0.147 278.027);
  --chart-3: oklch(0.71 0.147 278.027);
  --chart-4: oklch(0.748 0.127 278.896);
  --chart-5: oklch(0.952 0.127 103.946);
}