Swine for shadcn/ui

Swine is a shadcn/ui theme built around a near-black primary color (#181816) with near-black accents (#181618). The light mode uses a neutral background (#fefefb). Dark mode keeps the near-black primary (#181816) on a neutral background (#040401).

Color palette

TokenLightDark
Background
#fefefbwhite
#040401black
Foreground
#0c0d03black
#ffffffwhite
Card
#fefefbwhite
#040401black
Card foreground
#0c0d03black
#ffffffwhite
Popover
#fefefbwhite
#040401black
Popover foreground
#0c0d03black
#ffffffwhite
Primary
#181816black
#181816black
Primary foreground
#b4b5abdarkgray
#b4b5abdarkgray
Secondary
#161818black
#161818black
Secondary foreground
#abb4b5darkgray
#abb4b5darkgray
Muted
#dce4e4gainsboro
#1b2223black
Muted foreground
#575757dimgray
#a8a8a8darkgray
Accent
#181618black
#181618black
Accent foreground
#b5abb4darkgray
#b5abb4darkgray
Destructive
#bd190afirebrick
#ed1f0cred
Destructive foreground
#fffbfasnow
#ffffffwhite
Border
#e5e7eblavender
#1f2937darkslategray
Input
#e5e7eblavender
#1f2937darkslategray
Ring
#181816black
#181816black

Contrast

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

Light mode
Text on background19.32:1AAA
Text on card19.32:1AAA
Primary button8.56:1AAA
Secondary button8.41:1AAA
Muted text5.60:1AA
Accent8.11:1AAA
Destructive6.18:1AA
Dark mode
Text on background20.52:1AAA
Text on card20.52:1AAA
Primary button8.56:1AAA
Secondary button8.41:1AAA
Muted text6.78:1AA
Accent8.11:1AAA
Destructive4.35:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.996 0.004 108.011);
  --foreground: oklch(0.153 0.023 110.226);
  --muted: oklch(0.913 0.008 199.483);
  --muted-foreground: oklch(0.456 0 180);
  --popover: oklch(0.996 0.004 108.011);
  --popover-foreground: oklch(0.153 0.023 110.226);
  --card: oklch(0.996 0.004 108.011);
  --card-foreground: oklch(0.153 0.023 110.226);
  --border: oklch(0.928 0.006 264.531);
  --input: oklch(0.928 0.006 264.531);
  --primary: oklch(0.209 0.005 108.401);
  --primary-foreground: oklch(0.769 0.013 108.254);
  --secondary: oklch(0.207 0.004 199.342);
  --secondary-foreground: oklch(0.764 0.01 199.424);
  --accent: oklch(0.203 0.007 326.825);
  --accent-foreground: oklch(0.753 0.017 326.732);
  --destructive: oklch(0.51 0.197 30.088);
  --destructive-foreground: oklch(0.99 0.005 23.625);
  --ring: oklch(0.209 0.005 108.401);
  --chart-1: oklch(0.209 0.005 108.401);
  --chart-2: oklch(0.207 0.004 199.342);
  --chart-3: oklch(0.203 0.007 326.825);
  --chart-4: oklch(0.241 0.005 199.316);
  --chart-5: oklch(0.212 0.008 108.613);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.104 0.015 109.919);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.246 0.011 199.036);
  --muted-foreground: oklch(0.733 0 180);
  --popover: oklch(0.104 0.015 109.919);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.104 0.015 109.919);
  --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.209 0.005 108.401);
  --primary-foreground: oklch(0.769 0.013 108.254);
  --secondary: oklch(0.207 0.004 199.342);
  --secondary-foreground: oklch(0.764 0.01 199.424);
  --accent: oklch(0.203 0.007 326.825);
  --accent-foreground: oklch(0.753 0.017 326.732);
  --destructive: oklch(0.604 0.235 30.069);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.209 0.005 108.401);
  --chart-1: oklch(0.209 0.005 108.401);
  --chart-2: oklch(0.207 0.004 199.342);
  --chart-3: oklch(0.203 0.007 326.825);
  --chart-4: oklch(0.241 0.005 199.316);
  --chart-5: oklch(0.212 0.008 108.613);
}