Fix for shadcn/ui

Fix is a shadcn/ui theme built around a near-white primary color (#fefbfb) with muted light red accents (#d0c2c4). The light mode uses a neutral background (#fefbfb). Dark mode keeps the near-white primary (#fefbfb) on a red-tinted background (#0c0405).

Color palette

TokenLightDark
Background
#fefbfbsnow
#0c0405black
Foreground
#080203black
#ffffffwhite
Card
#fdf6f7snow
#100506black
Card foreground
#040101black
#ffffffwhite
Popover
#fdf6f7snow
#100506black
Popover foreground
#040101black
#ffffffwhite
Primary
#fefbfbsnow
#fefbfbsnow
Primary foreground
#9f2838brown
#9f2838brown
Secondary
#e4e2e2gainsboro
#332e2edarkslategray
Secondary foreground
#4d4748darkslategray
#cdc6c7silver
Muted
#e6d1d3gainsboro
#2e191cblack
Muted foreground
#484142darkslategray
#beb7b8silver
Accent
#d0c2c4silver
#493639darkslategray
Accent foreground
#372a2cdarkslategray
#ded3d5lightgrey
Destructive
#b63c0cfirebrick
#f3723ftomato
Destructive foreground
#ffffffwhite
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#fefbfbsnow
#fefbfbsnow

Contrast

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

Light mode
Text on background19.97:1AAA
Text on card19.57:1AAA
Primary button7.19:1AAA
Secondary button7.03:1AAA
Muted text6.81:1AA
Accent8.00:1AAA
Destructive5.76:1AA
Dark mode
Text on background20.33:1AAA
Text on card20.09:1AAA
Primary button7.19:1AAA
Secondary button7.97:1AAA
Muted text8.36:1AAA
Accent7.66:1AAA
Destructive7.28:1AAA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.99 0.004 7.841);
  --foreground: oklch(0.103 0.02 8.882);
  --muted: oklch(0.878 0.024 8.418);
  --muted-foreground: oklch(0.384 0.01 8.353);
  --popover: oklch(0.98 0.008 7.936);
  --popover-foreground: oklch(0.082 0.016 8.882);
  --card: oklch(0.98 0.008 7.936);
  --card-foreground: oklch(0.082 0.016 8.882);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.99 0.003 7.83);
  --primary-foreground: oklch(0.47 0.155 18.37);
  --secondary: oklch(0.914 0.002 7.815);
  --secondary-foreground: oklch(0.404 0.008 8.235);
  --accent: oklch(0.828 0.016 8.216);
  --accent-foreground: oklch(0.301 0.019 9.276);
  --destructive: oklch(0.527 0.166 38.076);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.99 0.003 7.83);
  --chart-1: oklch(0.99 0.003 7.83);
  --chart-2: oklch(0.914 0.002 7.815);
  --chart-3: oklch(0.828 0.016 8.216);
  --chart-4: oklch(0.938 0.002 7.795);
  --chart-5: oklch(0.99 0.003 7.835);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.12 0.019 8.763);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.243 0.035 11.297);
  --muted-foreground: oklch(0.784 0.008 7.995);
  --popover: oklch(0.134 0.023 9.576);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.134 0.023 9.576);
  --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.99 0.003 7.83);
  --primary-foreground: oklch(0.47 0.155 18.37);
  --secondary: oklch(0.306 0.009 8.428);
  --secondary-foreground: oklch(0.833 0.007 7.962);
  --accent: oklch(0.356 0.028 9.641);
  --accent-foreground: oklch(0.877 0.013 8.106);
  --destructive: oklch(0.697 0.171 40.999);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.99 0.003 7.83);
  --chart-1: oklch(0.99 0.003 7.83);
  --chart-2: oklch(0.306 0.009 8.428);
  --chart-3: oklch(0.356 0.028 9.641);
  --chart-4: oklch(0.335 0.01 8.45);
  --chart-5: oklch(0.99 0.003 7.835);
}