Magnet for shadcn/ui

Magnet is a shadcn/ui theme built around a muted deep cyan primary color (#1c2426) with muted deep blue accents (#1c1f26). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted deep cyan primary (#1c2426) on a neutral background (#010304).

Color palette

TokenLightDark
Background
#ffffffwhite
#010304black
Foreground
#010405black
#f9fafbghostwhite
Card
#ffffffwhite
#010304black
Card foreground
#010405black
#f9fafbghostwhite
Popover
#ffffffwhite
#010304black
Popover foreground
#010405black
#f9fafbghostwhite
Primary
#1c2426black
#1c2426black
Primary foreground
#b0c0c4silver
#b0c0c4silver
Secondary
#1c2623black
#1c2623black
Secondary foreground
#b0c4bfsilver
#b0c4bfsilver
Muted
#d8deddgainsboro
#212725darkslategray
Muted foreground
#455450darkslategray
#abbab6darkgray
Accent
#1c1f26black
#1c1f26black
Accent foreground
#b0b5c4silver
#b0b5c4silver
Destructive
#db1a00red
#ff2b0forangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#1c2426black
#1c2426black

Contrast

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

Light mode
Text on background20.57:1AAA
Text on card20.57:1AAA
Primary button8.42:1AAA
Secondary button8.49:1AAA
Muted text5.85:1AA
Accent8.05:1AAA
Destructive5.04:1AA
Dark mode
Text on background19.74:1AAA
Text on card19.74:1AAA
Primary button8.42:1AAA
Secondary button8.49:1AAA
Muted text7.58:1AAA
Accent8.05:1AAA
Destructive3.74:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(1 0 180);
  --foreground: oklch(0.096 0.013 211.813);
  --muted: oklch(0.896 0.006 178.574);
  --muted-foreground: oklch(0.432 0.02 177.361);
  --popover: oklch(1 0 180);
  --popover-foreground: oklch(0.096 0.013 211.813);
  --card: oklch(1 0 180);
  --card-foreground: oklch(0.096 0.013 211.813);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.253 0.012 218.146);
  --primary-foreground: oklch(0.796 0.019 217.905);
  --secondary: oklch(0.259 0.015 177.015);
  --secondary-foreground: oklch(0.805 0.024 177.909);
  --accent: oklch(0.239 0.015 269.519);
  --accent-foreground: oklch(0.775 0.022 269.862);
  --destructive: oklch(0.568 0.223 30.666);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.253 0.012 218.146);
  --chart-1: oklch(0.253 0.012 218.146);
  --chart-2: oklch(0.259 0.015 177.015);
  --chart-3: oklch(0.239 0.015 269.519);
  --chart-4: oklch(0.292 0.018 176.913);
  --chart-5: oklch(0.254 0.014 218.262);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.095 0.01 213.127);
  --foreground: oklch(0.985 0.002 217.752);
  --muted: oklch(0.265 0.009 177.811);
  --muted-foreground: oklch(0.776 0.018 178.108);
  --popover: oklch(0.095 0.01 213.127);
  --popover-foreground: oklch(0.985 0.002 217.752);
  --card: oklch(0.095 0.01 213.127);
  --card-foreground: oklch(0.985 0.002 217.752);
  --border: oklch(0.278 0.03 256.848);
  --input: oklch(0.278 0.03 256.848);
  --primary: oklch(0.253 0.012 218.146);
  --primary-foreground: oklch(0.796 0.019 217.905);
  --secondary: oklch(0.259 0.015 177.015);
  --secondary-foreground: oklch(0.805 0.024 177.909);
  --accent: oklch(0.239 0.015 269.519);
  --accent-foreground: oklch(0.775 0.022 269.862);
  --destructive: oklch(0.642 0.244 30.836);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.253 0.012 218.146);
  --chart-1: oklch(0.253 0.012 218.146);
  --chart-2: oklch(0.259 0.015 177.015);
  --chart-3: oklch(0.239 0.015 269.519);
  --chart-4: oklch(0.292 0.018 176.913);
  --chart-5: oklch(0.254 0.014 218.262);
}