Dark C++ Theme for shadcn/ui

Dark C++ Theme is a shadcn/ui theme built around a near-white primary color (#ffffff) with muted deep green accents (#45493c). The light mode uses a green-tinted background (#1d1f19). Dark mode keeps the near-white primary (#ffffff) on a green-tinted background (#1d1f19).

Color palette

TokenLightDark
Background
#1d1f19black
#1d1f19black
Foreground
#f0ffffazure
#f0ffffazure
Card
#181915black
#181915black
Card foreground
#ffffffwhite
#ffffffwhite
Popover
#151612black
#151612black
Popover foreground
#ffffffwhite
#ffffffwhite
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#282b22darkslategray
#282b22darkslategray
Muted foreground
#a9b09bdarkgray
#a9b09bdarkgray
Accent
#45493cdarkslategray
#45493cdarkslategray
Accent foreground
#dcdfd8gainsboro
#dcdfd8gainsboro
Destructive
#e61405red
#e61405red
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#292929darkslategray
#292929darkslategray
Input
#303030darkslategray
#303030darkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background16.22:1AAA
Text on card17.64:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.43:1AA
Accent6.88:1AA
Destructive4.70:1AA
Dark mode
Text on background16.22:1AAA
Text on card17.64:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.43:1AA
Accent6.88:1AA
Destructive4.70:1AA

CSS variables

Paste this into your globals.css to use Dark C++ Theme in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.235 0.011 122.245);
  --foreground: oklch(0.989 0.016 196.897);
  --muted: oklch(0.282 0.017 122.471);
  --muted-foreground: oklch(0.747 0.031 122.167);
  --popover: oklch(0.199 0.008 122.164);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.211 0.009 122.195);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.28 0 180);
  --input: oklch(0.311 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.397 0.022 122.415);
  --accent-foreground: oklch(0.899 0.01 121.671);
  --destructive: oklch(0.585 0.234 29.779);
  --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.397 0.022 122.415);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.235 0.011 122.245);
  --foreground: oklch(0.989 0.016 196.897);
  --muted: oklch(0.282 0.017 122.471);
  --muted-foreground: oklch(0.747 0.031 122.167);
  --popover: oklch(0.199 0.008 122.164);
  --popover-foreground: oklch(1 0 180);
  --card: oklch(0.211 0.009 122.195);
  --card-foreground: oklch(1 0 180);
  --border: oklch(0.28 0 180);
  --input: oklch(0.311 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.397 0.022 122.415);
  --accent-foreground: oklch(0.899 0.01 121.671);
  --destructive: oklch(0.585 0.234 29.779);
  --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.397 0.022 122.415);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}