Hat for shadcn/ui

Hat is a shadcn/ui theme built around a near-white primary color (#fbf8fc) with near-white accents (#f9fcf8). The light mode uses a neutral background (#fdfcfd). Dark mode keeps the near-white primary (#fbf8fc) on a violet-tinted background (#09050b).

Color palette

TokenLightDark
Background
#fdfcfdwhite
#09050bblack
Foreground
#100614black
#ffffffwhite
Card
#fdfcfdwhite
#09050bblack
Card foreground
#100614black
#ffffffwhite
Popover
#fdfcfdwhite
#09050bblack
Popover foreground
#100614black
#ffffffwhite
Primary
#fbf8fcghostwhite
#fbf8fcghostwhite
Primary foreground
#703d85rebeccapurple
#703d85rebeccapurple
Secondary
#f9fcf8mintcream
#f9fcf8mintcream
Secondary foreground
#273f1ddarkslategray
#273f1ddarkslategray
Muted
#ecf0ealinen
#10150fblack
Muted foreground
#5a6855dimgray
#9daa97darkgray
Accent
#f9fcf8mintcream
#f9fcf8mintcream
Accent foreground
#273f1ddarkslategray
#273f1ddarkslategray
Destructive
#a64511saddlebrown
#d95b17chocolate
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fbf8fcghostwhite
#fbf8fcghostwhite

Contrast

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

Light mode
Text on background19.33:1AAA
Text on card19.33:1AAA
Primary button7.39:1AAA
Secondary button11.17:1AAA
Muted text5.14:1AA
Accent11.17:1AAA
Destructive6.00:1AA
Dark mode
Text on background20.27:1AAA
Text on card20.27:1AAA
Primary button7.39:1AAA
Secondary button11.17:1AAA
Muted text7.58:1AAA
Accent11.17:1AAA
Destructive3.85:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.991 0.003 316.6);
  --foreground: oklch(0.146 0.033 316.357);
  --muted: oklch(0.951 0.01 136.64);
  --muted-foreground: oklch(0.499 0.034 136.824);
  --popover: oklch(0.991 0.003 316.6);
  --popover-foreground: oklch(0.146 0.033 316.357);
  --card: oklch(0.991 0.003 316.6);
  --card-foreground: oklch(0.146 0.033 316.357);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.982 0.006 316.592);
  --primary-foreground: oklch(0.454 0.125 315.579);
  --secondary: oklch(0.987 0.006 136.626);
  --secondary-foreground: oklch(0.338 0.064 137.431);
  --accent: oklch(0.987 0.006 136.626);
  --accent-foreground: oklch(0.338 0.064 137.431);
  --destructive: oklch(0.514 0.141 43.831);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.982 0.006 316.592);
  --chart-1: oklch(0.982 0.006 316.592);
  --chart-2: oklch(0.987 0.006 136.626);
  --chart-3: oklch(0.987 0.006 136.626);
  --chart-4: oklch(1.006 0.003 316.601);
  --chart-5: oklch(0.982 0.006 316.59);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.124 0.019 317.927);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.189 0.015 136.859);
  --muted-foreground: oklch(0.722 0.031 136.74);
  --popover: oklch(0.124 0.019 317.927);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.124 0.019 317.927);
  --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.982 0.006 316.592);
  --primary-foreground: oklch(0.454 0.125 315.579);
  --secondary: oklch(0.987 0.006 136.626);
  --secondary-foreground: oklch(0.338 0.064 137.431);
  --accent: oklch(0.987 0.006 136.626);
  --accent-foreground: oklch(0.338 0.064 137.431);
  --destructive: oklch(0.623 0.174 43.394);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.982 0.006 316.592);
  --chart-1: oklch(0.982 0.006 316.592);
  --chart-2: oklch(0.987 0.006 136.626);
  --chart-3: oklch(0.987 0.006 136.626);
  --chart-4: oklch(1.006 0.003 316.601);
  --chart-5: oklch(0.982 0.006 316.59);
}