Knight for shadcn/ui

Knight is a shadcn/ui theme built around a green primary color (#b7cb86) with purple accents (#cb86b7). The light mode uses a neutral background (#fdfefb). Dark mode keeps the green primary (#b7cb86) on a green-tinted background (#0c0f06).

Color palette

TokenLightDark
Background
#fdfefbwhite
#0c0f06black
Foreground
#090c04black
#fbfbf8snow
Card
#fbfdf7snow
#0f1207black
Card foreground
#060802black
#fdfdfcwhite
Popover
#fdfefbwhite
#0c0f06black
Popover foreground
#090c04black
#fbfbf8snow
Primary
#b7cb86darkkhaki
#b7cb86darkkhaki
Primary foreground
#121509black
#121509black
Secondary
#86b7cbskyblue
#86b7cbskyblue
Secondary foreground
#091215black
#091215black
Muted
#dae3e7gainsboro
#182125black
Muted foreground
#4f6169dimgray
#96a9b0darkgray
Accent
#cb86b7orchid
#cb86b7orchid
Accent foreground
#150912black
#150912black
Destructive
#70270asaddlebrown
#eb5c24chocolate
Destructive foreground
#f8c8b4peachpuff
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#b7cb86darkkhaki
#b7cb86darkkhaki

Contrast

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

Light mode
Text on background19.44:1AAA
Text on card19.60:1AAA
Primary button10.47:1AAA
Secondary button8.71:1AAA
Muted text4.97:1AA
Accent7.05:1AAA
Destructive7.00:1AAA
Dark mode
Text on background18.68:1AAA
Text on card18.55:1AAA
Primary button10.47:1AAA
Secondary button8.71:1AAA
Muted text6.67:1AA
Accent7.05:1AAA
Destructive6.07:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.004 119.368);
  --foreground: oklch(0.147 0.02 119.547);
  --muted: oklch(0.91 0.011 223.256);
  --muted-foreground: oklch(0.481 0.025 223.825);
  --popover: oklch(0.995 0.004 119.368);
  --popover-foreground: oklch(0.147 0.02 119.547);
  --card: oklch(0.99 0.007 119.433);
  --card-foreground: oklch(0.128 0.018 119.279);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.811 0.094 121.396);
  --primary-foreground: oklch(0.19 0.024 121.563);
  --secondary: oklch(0.752 0.059 224.38);
  --secondary-foreground: oklch(0.175 0.015 224.503);
  --accent: oklch(0.705 0.107 337.744);
  --accent-foreground: oklch(0.163 0.027 337.967);
  --destructive: oklch(0.378 0.11 39.453);
  --destructive-foreground: oklch(0.869 0.061 42.651);
  --ring: oklch(0.811 0.094 121.396);
  --chart-1: oklch(0.811 0.094 121.396);
  --chart-2: oklch(0.752 0.059 224.38);
  --chart-3: oklch(0.705 0.107 337.744);
  --chart-4: oklch(0.774 0.054 224.174);
  --chart-5: oklch(0.817 0.101 121.537);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.16 0.019 120.597);
  --foreground: oklch(0.988 0.004 119.371);
  --muted: oklch(0.242 0.015 223.993);
  --muted-foreground: oklch(0.722 0.023 223.504);
  --popover: oklch(0.16 0.019 120.597);
  --popover-foreground: oklch(0.988 0.004 119.371);
  --card: oklch(0.176 0.022 121.317);
  --card-foreground: oklch(0.994 0.002 119.337);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.811 0.094 121.396);
  --primary-foreground: oklch(0.19 0.024 121.563);
  --secondary: oklch(0.752 0.059 224.38);
  --secondary-foreground: oklch(0.175 0.015 224.503);
  --accent: oklch(0.705 0.107 337.744);
  --accent-foreground: oklch(0.163 0.027 337.967);
  --destructive: oklch(0.653 0.188 39.565);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.811 0.094 121.396);
  --chart-1: oklch(0.811 0.094 121.396);
  --chart-2: oklch(0.752 0.059 224.38);
  --chart-3: oklch(0.705 0.107 337.744);
  --chart-4: oklch(0.774 0.054 224.174);
  --chart-5: oklch(0.817 0.101 121.537);
}