Switching for shadcn/ui

Switching is a shadcn/ui theme built around a muted red primary color (#ab7973) with muted cyan accents (#73a4ab). The light mode uses a neutral background (#fcf8f8). Dark mode keeps the muted red primary (#ab7973) on a neutral background (#030202).

Color palette

TokenLightDark
Background
#fcf8f8snow
#030202black
Foreground
#040101black
#fdfcfcsnow
Card
#fcf8f8snow
#030202black
Card foreground
#040101black
#fdfcfcsnow
Popover
#fcf8f8snow
#030202black
Popover foreground
#040101black
#fdfcfcsnow
Primary
#ab7973rosybrown
#ab7973rosybrown
Primary foreground
#000000black
#000000black
Secondary
#73a4abcadetblue
#73a4abcadetblue
Secondary foreground
#000000black
#000000black
Muted
#cee1e4gainsboro
#1b2f31darkslategray
Muted foreground
#536365dimgray
#9aaaacdarkgray
Accent
#73a4abcadetblue
#73a4abcadetblue
Accent foreground
#000000black
#000000black
Destructive
#6e1708maroon
#f14f32tomato
Destructive foreground
#f9b9aelightpink
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#ab7973rosybrown
#ab7973rosybrown

Contrast

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

Light mode
Text on background19.75:1AAA
Text on card19.75:1AAA
Primary button5.72:1AA
Secondary button7.64:1AAA
Muted text4.64:1AA
Accent7.64:1AAA
Destructive7.05:1AAA
Dark mode
Text on background20.23:1AAA
Text on card20.23:1AAA
Primary button5.72:1AA
Secondary button7.64:1AAA
Muted text5.83:1AA
Accent7.64:1AAA
Destructive3.56:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.983 0.004 26.469);
  --foreground: oklch(0.084 0.015 33.308);
  --muted: oklch(0.897 0.021 206.319);
  --muted-foreground: oklch(0.486 0.02 206.267);
  --popover: oklch(0.983 0.004 26.469);
  --popover-foreground: oklch(0.084 0.015 33.308);
  --card: oklch(0.983 0.004 26.469);
  --card-foreground: oklch(0.084 0.015 33.308);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.625 0.063 27.443);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.687 0.054 206.305);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.687 0.054 206.305);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.354 0.123 32.308);
  --destructive-foreground: oklch(0.842 0.077 30.067);
  --ring: oklch(0.625 0.063 27.443);
  --chart-1: oklch(0.625 0.063 27.443);
  --chart-2: oklch(0.687 0.054 206.305);
  --chart-3: oklch(0.687 0.054 206.305);
  --chart-4: oklch(0.709 0.05 206.279);
  --chart-5: oklch(0.623 0.071 27.614);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.088 0.007 29.01);
  --foreground: oklch(0.992 0.001 26.448);
  --muted: oklch(0.289 0.026 206.372);
  --muted-foreground: oklch(0.727 0.018 206.312);
  --popover: oklch(0.088 0.007 29.01);
  --popover-foreground: oklch(0.992 0.001 26.448);
  --card: oklch(0.088 0.007 29.01);
  --card-foreground: oklch(0.992 0.001 26.448);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.625 0.063 27.443);
  --primary-foreground: oklch(0 0 0);
  --secondary: oklch(0.687 0.054 206.305);
  --secondary-foreground: oklch(0 0 0);
  --accent: oklch(0.687 0.054 206.305);
  --accent-foreground: oklch(0 0 0);
  --destructive: oklch(0.648 0.203 32.374);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.625 0.063 27.443);
  --chart-1: oklch(0.625 0.063 27.443);
  --chart-2: oklch(0.687 0.054 206.305);
  --chart-3: oklch(0.687 0.054 206.305);
  --chart-4: oklch(0.709 0.05 206.279);
  --chart-5: oklch(0.623 0.071 27.614);
}