GitHub Sharp Dark for shadcn/ui

GitHub Sharp Dark is a shadcn/ui theme built around a near-white primary color (#ffffff) with neutral gray accents (#474d4d). The light mode uses a neutral background (#222525). Dark mode keeps the near-white primary (#ffffff) on a neutral background (#222525).

Color palette

TokenLightDark
Background
#222525darkslategray
#222525darkslategray
Foreground
#c4c7casilver
#c4c7casilver
Card
#1d2020black
#1d2020black
Card foreground
#d1d4d6lightgrey
#d1d4d6lightgrey
Popover
#1b1d1dblack
#1b1d1dblack
Popover foreground
#dfe0e2gainsboro
#dfe0e2gainsboro
Primary
#ffffffwhite
#ffffffwhite
Primary foreground
#333333darkslategray
#333333darkslategray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#283333darkslategray
#283333darkslategray
Muted foreground
#a4b7b7darkgray
#a4b7b7darkgray
Accent
#474d4ddarkslategray
#474d4ddarkslategray
Accent foreground
#e2e4e4gainsboro
#e2e4e4gainsboro
Destructive
#d11815firebrick
#d11815firebrick
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#303030darkslategray
#303030darkslategray
Input
#383838darkslategray
#383838darkslategray
Ring
#ffffffwhite
#ffffffwhite

Contrast

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

Light mode
Text on background9.08:1AAA
Text on card11.02:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.19:1AA
Accent6.75:1AA
Destructive5.46:1AA
Dark mode
Text on background9.08:1AAA
Text on card11.02:1AAA
Primary button12.63:1AAA
Secondary button7.37:1AAA
Muted text6.19:1AA
Accent6.75:1AA
Destructive5.46:1AA

CSS variables

Paste this into your globals.css to use GitHub Sharp Dark in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.262 0.004 196.902);
  --foreground: oklch(0.828 0.005 247.885);
  --muted: oklch(0.313 0.015 196.415);
  --muted-foreground: oklch(0.765 0.022 196.709);
  --popover: oklch(0.229 0.003 196.92);
  --popover-foreground: oklch(0.907 0.003 247.852);
  --card: oklch(0.24 0.004 196.913);
  --card-foreground: oklch(0.868 0.004 247.868);
  --border: oklch(0.311 0 180);
  --input: oklch(0.341 0 158.199);
  --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.415 0.008 196.861);
  --accent-foreground: oklch(0.917 0.002 197.115);
  --destructive: oklch(0.548 0.214 28.62);
  --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.415 0.008 196.861);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.262 0.004 196.902);
  --foreground: oklch(0.828 0.005 247.885);
  --muted: oklch(0.313 0.015 196.415);
  --muted-foreground: oklch(0.765 0.022 196.709);
  --popover: oklch(0.229 0.003 196.92);
  --popover-foreground: oklch(0.907 0.003 247.852);
  --card: oklch(0.24 0.004 196.913);
  --card-foreground: oklch(0.868 0.004 247.868);
  --border: oklch(0.311 0 180);
  --input: oklch(0.341 0 158.199);
  --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.415 0.008 196.861);
  --accent-foreground: oklch(0.917 0.002 197.115);
  --destructive: oklch(0.548 0.214 28.62);
  --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.415 0.008 196.861);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(1 0 180);
}