CodeSandbox Black 2021 for shadcn/ui

CodeSandbox Black 2021 is a shadcn/ui theme built around a near-white primary color (#ffffff) with neutral gray accents (#3b3b3b). The light mode uses a neutral background (#141414). Dark mode keeps the near-white primary (#ffffff) on a neutral background (#141414).

Color palette

TokenLightDark
Background
#141414black
#141414black
Foreground
#ffffffwhite
#ffffffwhite
Card
#0f0f0fblack
#0f0f0fblack
Card foreground
#ffffffwhite
#ffffffwhite
Popover
#0d0d0dblack
#0d0d0dblack
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#2b2222darkslategray
#2b2222darkslategray
Muted foreground
#b09b9brosybrown
#b09b9brosybrown
Accent
#3b3b3bdarkslategray
#3b3b3bdarkslategray
Accent foreground
#d4d4d4lightgrey
#d4d4d4lightgrey
Destructive
#e31502red
#e31502red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#212121black
#212121black
Input
#292929darkslategray
#292929darkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background18.35:1AAA
Text on card19.12:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.93:1AA
Accent7.59:1AAA
Destructive4.79:1AA
Dark mode
Text on background18.35:1AAA
Text on card19.12:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text5.93:1AA
Accent7.59:1AAA
Destructive4.79:1AA

CSS variables

Paste this into your globals.css to use CodeSandbox Black 2021 in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.193 0 164.055);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.261 0.014 18.092);
  --muted-foreground: oklch(0.708 0.025 17.766);
  --popover: oklch(0.158 0 169.695);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.17 0 180);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.248 0 173.29);
  --input: oklch(0.28 0 180);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.351 0 167.471);
  --accent-foreground: oklch(0.869 0 165.964);
  --destructive: oklch(0.581 0.231 30.053);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.351 0 167.471);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.193 0 164.055);
  --foreground: oklch(1 0 180);
  --muted: oklch(0.261 0.014 18.092);
  --muted-foreground: oklch(0.708 0.025 17.766);
  --popover: oklch(0.158 0 169.695);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.17 0 180);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.248 0 173.29);
  --input: oklch(0.28 0 180);
  --primary: oklch(1 0 180);
  --primary-foreground: oklch(0.321 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.351 0 167.471);
  --accent-foreground: oklch(0.869 0 165.964);
  --destructive: oklch(0.581 0.231 30.053);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(1 0 180);
  --chart-1: oklch(1 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.351 0 167.471);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}