dark2 for shadcn/ui

dark2 is a shadcn/ui theme built around a vivid yellow primary color (#efba0b) with muted light yellow accents (#e4e2dd). The light mode uses a neutral background (#fefdfb). Dark mode keeps the vivid yellow primary (#efba0b) on a neutral background (#000000).

Color palette

TokenLightDark
Background
#fefdfbsnow
#000000black
Foreground
#040301black
#fcfbf8snow
Card
#fdfcf6snow
#030303black
Card foreground
#000000black
#fdfdfbsnow
Popover
#fdfcf6snow
#030303black
Popover foreground
#000000black
#fdfdfbsnow
Primary
#efba0borange
#efba0borange
Primary foreground
#2c2202black
#2c2202black
Secondary
#e4e2ddgainsboro
#171716black
Secondary foreground
#504c3fdarkolivegreen
#b2b1aedarkgray
Muted
#ecebe9linen
#161513black
Muted foreground
#686250dimgray
#afaa97darkgray
Accent
#e4e2ddgainsboro
#171716black
Accent foreground
#504c3fdarkolivegreen
#b2b1aedarkgray
Destructive
#aa2909firebrick
#da350borangered
Destructive foreground
#feebe7linen
#ffffffwhite
Border
#ebebealinen
#282725darkslategray
Input
#ebebealinen
#282725darkslategray
Ring
#efba0borange
#efba0borange

Contrast

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

Light mode
Text on background20.33:1AAA
Text on card20.42:1AAA
Primary button8.71:1AAA
Secondary button6.64:1AA
Muted text5.11:1AA
Accent6.64:1AA
Destructive6.04:1AA
Dark mode
Text on background20.29:1AAA
Text on card20.30:1AAA
Primary button8.71:1AAA
Secondary button8.34:1AAA
Muted text7.83:1AAA
Accent8.34:1AAA
Destructive4.67:1AA

CSS variables

Paste this into your globals.css to use dark2 in your shadcn/ui project.

:root {
  --radius: 0.5rem;
  --background: oklch(0.995 0.004 92.694);
  --foreground: oklch(0.101 0.015 98.171);
  --muted: oklch(0.941 0.003 92.688);
  --muted-foreground: oklch(0.497 0.029 93.098);
  --popover: oklch(0.99 0.007 92.73);
  --popover-foreground: oklch(0 0 0);
  --card: oklch(0.99 0.007 92.73);
  --card-foreground: oklch(0 0 0);
  --border: oklch(0.94 0.002 92.675);
  --input: oklch(0.94 0.002 92.675);
  --primary: oklch(0.813 0.165 87.541);
  --primary-foreground: oklch(0.257 0.05 91.903);
  --secondary: oklch(0.914 0.008 92.74);
  --secondary-foreground: oklch(0.416 0.022 93.068);
  --accent: oklch(0.914 0.008 92.74);
  --accent-foreground: oklch(0.416 0.022 93.068);
  --destructive: oklch(0.485 0.169 33.781);
  --destructive-foreground: oklch(0.955 0.021 34.297);
  --ring: oklch(0.813 0.165 87.541);
  --chart-1: oklch(0.813 0.165 87.541);
  --chart-2: oklch(0.914 0.008 92.74);
  --chart-3: oklch(0.914 0.008 92.74);
  --chart-4: oklch(0.935 0.006 92.718);
  --chart-5: oklch(0.821 0.167 87.131);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0 0 0);
  --foreground: oklch(0.988 0.004 92.697);
  --muted: oklch(0.196 0.004 92.865);
  --muted-foreground: oklch(0.736 0.026 92.968);
  --popover: oklch(0.092 0 180);
  --popover-foreground: oklch(0.994 0.002 92.677);
  --card: oklch(0.092 0 180);
  --card-foreground: oklch(0.994 0.002 92.677);
  --border: oklch(0.273 0.004 92.809);
  --input: oklch(0.273 0.004 92.809);
  --primary: oklch(0.813 0.165 87.541);
  --primary-foreground: oklch(0.257 0.05 91.903);
  --secondary: oklch(0.205 0.001 92.724);
  --secondary-foreground: oklch(0.76 0.004 92.702);
  --accent: oklch(0.205 0.001 92.724);
  --accent-foreground: oklch(0.76 0.004 92.702);
  --destructive: oklch(0.583 0.206 33.539);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.813 0.165 87.541);
  --chart-1: oklch(0.813 0.165 87.541);
  --chart-2: oklch(0.205 0.001 92.724);
  --chart-3: oklch(0.205 0.001 92.724);
  --chart-4: oklch(0.239 0.002 92.731);
  --chart-5: oklch(0.821 0.167 87.131);
}