Swift for shadcn/ui

Swift is a shadcn/ui theme built around a red primary color (#7e1b1e) with neutral gray accents (#dad8d8). The light mode uses a neutral background (#fdf6f7). Dark mode keeps the red primary (#7e1b1e) on a neutral background (#040102).

Color palette

TokenLightDark
Background
#fdf6f7snow
#040102black
Foreground
#080203black
#f9f6f6whitesmoke
Card
#fdf6f7snow
#040102black
Card foreground
#080203black
#f9f6f6whitesmoke
Popover
#fdf6f7snow
#040102black
Popover foreground
#080203black
#f9f6f6whitesmoke
Primary
#7e1b1emaroon
#7e1b1emaroon
Primary foreground
#f6d5d6mistyrose
#f6d5d6mistyrose
Secondary
#dad8d8gainsboro
#222020black
Secondary foreground
#423e3edarkslategray
#bcb8b8silver
Muted
#f1eeeewhitesmoke
#110e0eblack
Muted foreground
#4f4f4fdarkslategray
#b0b0b0darkgray
Accent
#dad8d8gainsboro
#222020black
Accent foreground
#423e3edarkslategray
#bcb8b8silver
Destructive
#782107maroon
#f25626tomato
Destructive foreground
#fbc7b7peachpuff
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#7e1b1emaroon
#7e1b1emaroon

Contrast

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

Light mode
Text on background19.37:1AAA
Text on card19.37:1AAA
Primary button7.46:1AAA
Secondary button7.41:1AAA
Muted text7.10:1AAA
Accent7.41:1AAA
Destructive6.86:1AA
Dark mode
Text on background19.31:1AAA
Text on card19.31:1AAA
Primary button7.46:1AAA
Secondary button8.23:1AAA
Muted text8.87:1AAA
Accent8.23:1AAA
Destructive3.41:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.98 0.007 14.93);
  --foreground: oklch(0.105 0.016 17.115);
  --muted: oklch(0.952 0.004 14.861);
  --muted-foreground: oklch(0.428 0 180);
  --popover: oklch(0.98 0.007 14.93);
  --popover-foreground: oklch(0.105 0.016 17.115);
  --card: oklch(0.98 0.007 14.93);
  --card-foreground: oklch(0.105 0.016 17.115);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.392 0.134 24.414);
  --primary-foreground: oklch(0.901 0.037 15.578);
  --secondary: oklch(0.883 0.003 14.843);
  --secondary-foreground: oklch(0.367 0.005 15.06);
  --accent: oklch(0.883 0.003 14.843);
  --accent-foreground: oklch(0.367 0.005 15.06);
  --destructive: oklch(0.386 0.125 35.903);
  --destructive-foreground: oklch(0.87 0.064 37.593);
  --ring: oklch(0.392 0.134 24.414);
  --chart-1: oklch(0.392 0.134 24.414);
  --chart-2: oklch(0.883 0.003 14.843);
  --chart-3: oklch(0.883 0.003 14.843);
  --chart-4: oklch(0.907 0.002 14.831);
  --chart-5: oklch(0.395 0.139 24.902);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.085 0.011 16.673);
  --foreground: oklch(0.975 0.004 14.859);
  --muted: oklch(0.166 0.006 15.446);
  --muted-foreground: oklch(0.757 0 180);
  --popover: oklch(0.085 0.011 16.673);
  --popover-foreground: oklch(0.975 0.004 14.859);
  --card: oklch(0.085 0.011 16.673);
  --card-foreground: oklch(0.975 0.004 14.859);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.392 0.134 24.414);
  --primary-foreground: oklch(0.901 0.037 15.578);
  --secondary: oklch(0.246 0.003 15.021);
  --secondary-foreground: oklch(0.786 0.005 14.901);
  --accent: oklch(0.246 0.003 15.021);
  --accent-foreground: oklch(0.786 0.005 14.901);
  --destructive: oklch(0.658 0.201 36.507);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.392 0.134 24.414);
  --chart-1: oklch(0.392 0.134 24.414);
  --chart-2: oklch(0.246 0.003 15.021);
  --chart-3: oklch(0.246 0.003 15.021);
  --chart-4: oklch(0.278 0.004 15.035);
  --chart-5: oklch(0.395 0.139 24.902);
}