Dark Mode MDN is a shadcn/ui theme built around a neutral gray primary color (#d9d9d9) with neutral gray accents (#4c4e57). The light mode uses a neutral background (#28292e). Dark mode keeps the neutral gray primary (#d9d9d9) on a neutral background (#28292e).
| Token | Light | Dark |
|---|---|---|
| Background | #28292edarkslategray | #28292edarkslategray |
| Foreground | #f5f5f5whitesmoke | #f5f5f5whitesmoke |
| Card | #242429darkslategray | #242429darkslategray |
| Card foreground | #ffffffwhite | #ffffffwhite |
| Popover | #212226black | #212226black |
| Popover foreground | #ffffffwhite | #ffffffwhite |
| Primary | #d9d9d9gainsboro | #d9d9d9gainsboro |
| Primary foreground | #404040darkslategray | #404040darkslategray |
| Secondary | #404040darkslategray | #404040darkslategray |
| Secondary foreground | #d9d9d9gainsboro | #d9d9d9gainsboro |
| Muted | #2f313cdarkslategray | #2f313cdarkslategray |
| Muted foreground | #acafbedarkgray | #acafbedarkgray |
| Accent | #4c4e57darkslategray | #4c4e57darkslategray |
| Accent foreground | #e9eaeclavender | #e9eaeclavender |
| Destructive | #fe4d2atomato | #fe4d2atomato |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #383838darkslategray | #383838darkslategray |
| Input | #404040darkslategray | #404040darkslategray |
| Ring | #d9d9d9gainsboro | #d9d9d9gainsboro |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 13.25:1 | AAA |
| Text on card | 15.40:1 | AAA |
| Primary button | 7.32:1 | AAA |
| Secondary button | 7.37:1 | AAA |
| Muted text | 5.90:1 | AA |
| Accent | 6.89:1 | AA |
| Destructive | 3.32:1 | AA Large |
| Text on background | 13.25:1 | AAA |
| Text on card | 15.40:1 | AAA |
| Primary button | 7.32:1 | AAA |
| Secondary button | 7.37:1 | AAA |
| Muted text | 5.90:1 | AA |
| Accent | 6.89:1 | AA |
| Destructive | 3.32:1 | AA Large |
Paste this into your globals.css to use Dark Mode MDN in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.283 0.009 276.783);
--foreground: oklch(0.97 0 180);
--muted: oklch(0.317 0.019 276.337);
--muted-foreground: oklch(0.757 0.021 276.856);
--popover: oklch(0.253 0.008 276.809);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.263 0.008 276.8);
--card-foreground: oklch(1 0 180);
--border: oklch(0.341 0 158.199);
--input: oklch(0.371 0 168.69);
--primary: oklch(0.885 0 180);
--primary-foreground: oklch(0.371 0 168.69);
--secondary: oklch(0.371 0 168.69);
--secondary-foreground: oklch(0.885 0 180);
--accent: oklch(0.425 0.016 276.715);
--accent-foreground: oklch(0.936 0.003 277.212);
--destructive: oklch(0.668 0.218 33.104);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.885 0 180);
--chart-1: oklch(0.885 0 180);
--chart-2: oklch(0.371 0 168.69);
--chart-3: oklch(0.425 0.016 276.715);
--chart-4: oklch(0.399 0 180);
--chart-5: oklch(0.883 0.003 17.205);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.283 0.009 276.783);
--foreground: oklch(0.97 0 180);
--muted: oklch(0.317 0.019 276.337);
--muted-foreground: oklch(0.757 0.021 276.856);
--popover: oklch(0.253 0.008 276.809);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.263 0.008 276.8);
--card-foreground: oklch(1 0 180);
--border: oklch(0.341 0 158.199);
--input: oklch(0.371 0 168.69);
--primary: oklch(0.885 0 180);
--primary-foreground: oklch(0.371 0 168.69);
--secondary: oklch(0.371 0 168.69);
--secondary-foreground: oklch(0.885 0 180);
--accent: oklch(0.425 0.016 276.715);
--accent-foreground: oklch(0.936 0.003 277.212);
--destructive: oklch(0.668 0.218 33.104);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.885 0 180);
--chart-1: oklch(0.885 0 180);
--chart-2: oklch(0.371 0 168.69);
--chart-3: oklch(0.425 0.016 276.715);
--chart-4: oklch(0.399 0 180);
--chart-5: oklch(0.883 0.003 17.205);
}