Affair for shadcn/ui

Affair is a shadcn/ui theme built around a muted deep cyan primary color (#202b2c) with muted deep blue accents (#20242c). The light mode uses a neutral background (#fbfdfe). Dark mode keeps the muted deep cyan primary (#202b2c) on a cyan-tinted background (#050a0b).

Color palette

TokenLightDark
Background
#fbfdfewhite
#050a0bblack
Foreground
#020708black
#ffffffwhite
Card
#f7fcfcmintcream
#060d0eblack
Card foreground
#010404black
#ffffffwhite
Popover
#f7fcfcmintcream
#060d0eblack
Popover foreground
#010404black
#ffffffwhite
Primary
#202b2cdarkslategray
#202b2cdarkslategray
Primary foreground
#b5c6c9silver
#b5c6c9silver
Secondary
#202c28darkslategray
#202c28darkslategray
Secondary foreground
#b5c9c2silver
#b5c9c2silver
Muted
#d9e7e3gainsboro
#182621black
Muted foreground
#394c45darkslategray
#b3c6bfsilver
Accent
#20242cdarkslategray
#20242cdarkslategray
Accent foreground
#b5bcc9silver
#b5bcc9silver
Destructive
#9c330dsaddlebrown
#ef6634tomato
Destructive foreground
#fce6demistyrose
#000000black
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#202b2cdarkslategray
#202b2cdarkslategray

Contrast

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

Light mode
Text on background19.90:1AAA
Text on card19.85:1AAA
Primary button8.26:1AAA
Secondary button8.29:1AAA
Muted text7.21:1AAA
Accent8.11:1AAA
Destructive6.07:1AA
Dark mode
Text on background19.93:1AAA
Text on card19.57:1AAA
Primary button8.26:1AAA
Secondary button8.29:1AAA
Muted text8.81:1AAA
Accent8.11:1AAA
Destructive6.59:1AA

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.994 0.002 209.462);
  --foreground: oklch(0.122 0.014 205.825);
  --muted: oklch(0.917 0.016 173.046);
  --muted-foreground: oklch(0.397 0.026 171.522);
  --popover: oklch(0.987 0.005 209.456);
  --popover-foreground: oklch(0.097 0.011 205.825);
  --card: oklch(0.987 0.005 209.456);
  --card-foreground: oklch(0.097 0.011 205.825);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.278 0.015 209.486);
  --primary-foreground: oklch(0.815 0.019 209.43);
  --secondary: oklch(0.282 0.019 171.495);
  --secondary-foreground: oklch(0.82 0.024 172.687);
  --accent: oklch(0.261 0.016 262.831);
  --accent-foreground: oklch(0.794 0.02 262.99);
  --destructive: oklch(0.471 0.147 37.687);
  --destructive-foreground: oklch(0.941 0.027 41.11);
  --ring: oklch(0.278 0.015 209.486);
  --chart-1: oklch(0.278 0.015 209.486);
  --chart-2: oklch(0.282 0.019 171.495);
  --chart-3: oklch(0.261 0.016 262.831);
  --chart-4: oklch(0.315 0.022 171.398);
  --chart-5: oklch(0.28 0.017 209.531);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.138 0.011 207.05);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.252 0.022 170.781);
  --muted-foreground: oklch(0.81 0.022 172.756);
  --popover: oklch(0.152 0.012 208.653);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.152 0.012 208.653);
  --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.278 0.015 209.486);
  --primary-foreground: oklch(0.815 0.019 209.43);
  --secondary: oklch(0.282 0.019 171.495);
  --secondary-foreground: oklch(0.82 0.024 172.687);
  --accent: oklch(0.261 0.016 262.831);
  --accent-foreground: oklch(0.794 0.02 262.99);
  --destructive: oklch(0.673 0.18 39.338);
  --destructive-foreground: oklch(0 0 0);
  --ring: oklch(0.278 0.015 209.486);
  --chart-1: oklch(0.278 0.015 209.486);
  --chart-2: oklch(0.282 0.019 171.495);
  --chart-3: oklch(0.261 0.016 262.831);
  --chart-4: oklch(0.315 0.022 171.398);
  --chart-5: oklch(0.28 0.017 209.531);
}