Black and blue for shadcn/ui

Black and blue is a shadcn/ui theme built around a vivid blue primary color (#126eda) with vivid blue accents (#126eda). The light mode uses an indigo-tinted background (#09090b). Dark mode switches to a vivid light blue primary (#acd9fb) on a neutral background (#010304).

Color palette

TokenLightDark
Background
#09090bblack
#010304black
Foreground
#fdfdfdwhite
#ffffffwhite
Card
#37373bdarkslategray
#010304black
Card foreground
#fbfbfbsnow
#ffffffwhite
Popover
#37373bdarkslategray
#010304black
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#126edaroyalblue
#acd9fblightblue
Primary foreground
#ffffffwhite
#054270midnightblue
Secondary
#3f3f46darkslategray
#fbacd9pink
Secondary foreground
#ffffffwhite
#700542purple
Muted
#126edaroyalblue
#100e0fblack
Muted foreground
#ffffffwhite
#aaa7a9darkgray
Accent
#126edaroyalblue
#d9fbacpalegoldenrod
Accent foreground
#ffffffwhite
#090f01black
Destructive
#ff0000red
#f9521aorangered
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#37373bdarkslategray
#22272bdarkslategray
Input
#37373bdarkslategray
#22272bdarkslategray
Ring
#ffffffwhite
#acd9fblightblue

Contrast

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

Light mode
Text on background19.55:1AAA
Text on card11.45:1AAA
Primary button4.92:1AA
Secondary button10.44:1AAA
Muted text4.92:1AA
Accent4.92:1AA
Destructive3.99:1AA Large
Dark mode
Text on background20.68:1AAA
Text on card20.68:1AAA
Primary button6.96:1AA
Secondary button6.71:1AA
Muted text8.04:1AAA
Accent16.99:1AAA
Destructive3.35:1AA Large

CSS variables

Paste this into your globals.css to use Black and blue in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.141 0.004 285.823);
  --foreground: oklch(0.994 0 180);
  --muted: oklch(0.552 0.184 256.702);
  --muted-foreground: oklch(1 0 180);
  --popover: oklch(0.338 0.007 286.023);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.338 0.007 286.023);
  --card-foreground: oklch(0.988 0 171.87);
  --border: oklch(0.338 0.007 286.023);
  --input: oklch(0.338 0.007 286.023);
  --primary: oklch(0.552 0.184 256.702);
  --primary-foreground: oklch(1 0 180);
  --secondary: oklch(0.37 0.012 285.806);
  --secondary-foreground: oklch(1 0 180);
  --accent: oklch(0.552 0.184 256.702);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.628 0.258 29.234);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(0.552 0.184 256.702);
  --chart-2: oklch(0.37 0.012 285.806);
  --chart-3: oklch(0.552 0.184 256.702);
  --chart-4: oklch(0.398 0.013 285.794);
  --chart-5: oklch(0.553 0.189 257.02);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.091 0.008 233.789);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.168 0.004 342.328);
  --muted-foreground: oklch(0.73 0.005 341.966);
  --popover: oklch(0.091 0.008 233.789);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.091 0.008 233.789);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.269 0.011 240.84);
  --input: oklch(0.269 0.011 240.84);
  --primary: oklch(0.865 0.067 241.459);
  --primary-foreground: oklch(0.37 0.097 248.625);
  --secondary: oklch(0.834 0.108 344.687);
  --secondary-foreground: oklch(0.36 0.143 354.214);
  --accent: oklch(0.945 0.108 127.375);
  --accent-foreground: oklch(0.155 0.036 125.283);
  --destructive: oklch(0.664 0.212 36.664);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.865 0.067 241.459);
  --chart-1: oklch(0.865 0.067 241.459);
  --chart-2: oklch(0.834 0.108 344.687);
  --chart-3: oklch(0.945 0.108 127.375);
  --chart-4: oklch(0.862 0.088 344.105);
  --chart-5: oklch(0.865 0.069 241.504);
}