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 a neutral background (#000000). Dark mode keeps the vivid blue primary (#126eda) on an indigo-tinted background (#09090b).

Color palette

TokenLightDark
Background
#000000black
#09090bblack
Foreground
#ffffffwhite
#ffffffwhite
Card
#37373bdarkslategray
#37373bdarkslategray
Card foreground
#fdfdfdwhite
#ffffffwhite
Popover
#37373bdarkslategray
#37373bdarkslategray
Popover foreground
#9d8d9fdarkgray
#ffffffwhite
Primary
#126edaroyalblue
#126edaroyalblue
Primary foreground
#fdfdfdwhite
#eeeeeewhitesmoke
Secondary
#37373bdarkslategray
#3f3f46darkslategray
Secondary foreground
#fdfdfdwhite
#ffffffwhite
Muted
#126edaroyalblue
#37373bdarkslategray
Muted foreground
#fdfdfdwhite
#ffffffwhite
Accent
#126edaroyalblue
#126edaroyalblue
Accent foreground
#ffffffwhite
#ffffffwhite
Destructive
#126edaroyalblue
#cd0700red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#37373bdarkslategray
#37373bdarkslategray
Input
#fbfbfbsnow
#37373bdarkslategray
Ring
#692470rebeccapurple
#ffffffwhite

Contrast

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

Light mode
Text on background21.00:1AAA
Text on card11.65:1AAA
Primary button4.83:1AA
Secondary button11.65:1AAA
Muted text4.83:1AA
Accent4.92:1AA
Destructive4.92:1AA
Dark mode
Text on background19.89:1AAA
Text on card11.85:1AAA
Primary button4.24:1AA Large
Secondary button10.44:1AAA
Muted text11.85:1AAA
Accent4.92:1AA
Destructive5.79:1AA

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 0 0);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.552 0.184 256.702);
  --muted-foreground: oklch(0.994 0 180);
  --popover: oklch(0.338 0.007 286.023);
  --popover-foreground: oklch(0.663 0.033 323.357);
  --card: oklch(0.338 0.007 286.023);
  --card-foreground: oklch(0.994 0 180);
  --border: oklch(0.338 0.007 286.023);
  --input: oklch(0.988 0 171.87);
  --primary: oklch(0.552 0.184 256.702);
  --primary-foreground: oklch(0.994 0 180);
  --secondary: oklch(0.338 0.007 286.023);
  --secondary-foreground: oklch(0.994 0 180);
  --accent: oklch(0.552 0.184 256.702);
  --accent-foreground: oklch(1 0 180);
  --destructive: oklch(0.552 0.184 256.702);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.397 0.139 324.308);
  --chart-1: oklch(0.552 0.184 256.702);
  --chart-2: oklch(0.338 0.007 286.023);
  --chart-3: oklch(0.552 0.184 256.702);
  --chart-4: oklch(0.367 0.008 286.014);
  --chart-5: oklch(0.553 0.189 257.02);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.141 0.004 285.823);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.338 0.007 286.023);
  --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(1 0 180);
  --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(0.95 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.534 0.217 29.575);
  --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);
}