WeChat Dark for shadcn/ui

WeChat Dark is a shadcn/ui theme built around a near-white primary color (#f7f7f7) with neutral gray accents (#545454). The light mode uses a neutral background (#2e2e2e). Dark mode keeps the near-white primary (#f7f7f7) on a neutral background (#2e2e2e).

Color palette

TokenLightDark
Background
#2e2e2edarkslategray
#2e2e2edarkslategray
Foreground
#dbdbdbgainsboro
#dbdbdbgainsboro
Card
#292929darkslategray
#292929darkslategray
Card foreground
#e8e8e8lavender
#e8e8e8lavender
Popover
#262626darkslategray
#262626darkslategray
Popover foreground
#f5f5f5whitesmoke
#f5f5f5whitesmoke
Primary
#f7f7f7whitesmoke
#f7f7f7whitesmoke
Primary foreground
#5e5e5edimgray
#5e5e5edimgray
Secondary
#404040darkslategray
#404040darkslategray
Secondary foreground
#d9d9d9gainsboro
#d9d9d9gainsboro
Muted
#3f3131darkslategray
#3f3131darkslategray
Muted foreground
#c0afafsilver
#c0afafsilver
Accent
#545454dimgray
#545454dimgray
Accent foreground
#edededwhitesmoke
#edededwhitesmoke
Destructive
#f73d36tomato
#f73d36tomato
Destructive foreground
#ffffffwhite
#ffffffwhite
Border
#3b3b3bdarkslategray
#3b3b3bdarkslategray
Input
#424242darkslategray
#424242darkslategray
Ring
#f7f7f7whitesmoke
#f7f7f7whitesmoke

Contrast

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

Light mode
Text on background9.82:1AAA
Text on card11.90:1AAA
Primary button6.07:1AA
Secondary button7.37:1AAA
Muted text5.87:1AA
Accent6.45:1AA
Destructive3.71:1AA Large
Dark mode
Text on background9.82:1AAA
Text on card11.90:1AAA
Primary button6.07:1AA
Secondary button7.37:1AAA
Muted text5.87:1AA
Accent6.45:1AA
Destructive3.71:1AA Large

CSS variables

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

:root {
  --radius: 0.5rem;
  --background: oklch(0.301 0 189.462);
  --foreground: oklch(0.892 0 180);
  --muted: oklch(0.33 0.02 18.192);
  --muted-foreground: oklch(0.769 0.02 17.59);
  --popover: oklch(0.27 0 180);
  --popover-foreground: oklch(0.97 0 180);
  --card: oklch(0.28 0 180);
  --card-foreground: oklch(0.931 0 180);
  --border: oklch(0.351 0 167.471);
  --input: oklch(0.38 0 180);
  --primary: oklch(0.977 0 180);
  --primary-foreground: oklch(0.483 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.446 0 180);
  --accent-foreground: oklch(0.947 0 180);
  --destructive: oklch(0.642 0.223 27.6);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.977 0 180);
  --chart-1: oklch(0.977 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.446 0 180);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.977 0 17.167);
}

.dark {
  --radius: 0.5rem;
  --background: oklch(0.301 0 189.462);
  --foreground: oklch(0.892 0 180);
  --muted: oklch(0.33 0.02 18.192);
  --muted-foreground: oklch(0.769 0.02 17.59);
  --popover: oklch(0.27 0 180);
  --popover-foreground: oklch(0.97 0 180);
  --card: oklch(0.28 0 180);
  --card-foreground: oklch(0.931 0 180);
  --border: oklch(0.351 0 167.471);
  --input: oklch(0.38 0 180);
  --primary: oklch(0.977 0 180);
  --primary-foreground: oklch(0.483 0 180);
  --secondary: oklch(0.371 0 168.69);
  --secondary-foreground: oklch(0.885 0 180);
  --accent: oklch(0.446 0 180);
  --accent-foreground: oklch(0.947 0 180);
  --destructive: oklch(0.642 0.223 27.6);
  --destructive-foreground: oklch(1 0 180);
  --ring: oklch(0.977 0 180);
  --chart-1: oklch(0.977 0 180);
  --chart-2: oklch(0.371 0 168.69);
  --chart-3: oklch(0.446 0 180);
  --chart-4: oklch(0.399 0 180);
  --chart-5: oklch(0.977 0 17.167);
}