Modern is a shadcn/ui theme built around a neutral gray primary color (#7f7a7f) with neutral gray accents (#7f7a7d). The light mode uses a neutral background (#fdf7fd). Dark mode keeps the neutral gray primary (#7f7a7f) on a purple-tinted background (#0e060e).
| Token | Light | Dark |
|---|---|---|
| Background | #fdf7fdsnow | #0e060eblack |
| Foreground | #120312black | #fdfbfdsnow |
| Card | #fdf7fdsnow | #0e060eblack |
| Card foreground | #120312black | #fdfbfdsnow |
| Popover | #fdf7fdsnow | #0e060eblack |
| Popover foreground | #120312black | #fdfbfdsnow |
| Primary | #7f7a7fgray | #7f7a7fgray |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #7d7a7fgray | #7d7a7fgray |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #e8e4eclavender | #17131bblack |
| Muted foreground | #51495bdarkslategray | #ada4b6darkgray |
| Accent | #7f7a7dgray | #7f7a7dgray |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #6a1806maroon | #f13c13orangered |
| Destructive foreground | #fab7a8lightpink | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #7f7a7fgray | #7f7a7fgray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 18.98:1 | AAA |
| Text on card | 18.98:1 | AAA |
| Primary button | 4.18:1 | AA Large |
| Secondary button | 4.21:1 | AA Large |
| Muted text | 6.81:1 | AA |
| Accent | 4.19:1 | AA Large |
| Destructive | 7.08:1 | AAA |
| Text on background | 19.37:1 | AAA |
| Text on card | 19.37:1 | AAA |
| Primary button | 4.18:1 | AA Large |
| Secondary button | 4.21:1 | AA Large |
| Muted text | 7.66:1 | AAA |
| Accent | 4.19:1 | AA Large |
| Destructive | 3.89:1 | AA Large |
Paste this into your globals.css to use Modern in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.982 0.01 325.168);
--foreground: oklch(0.137 0.046 327.162);
--muted: oklch(0.924 0.012 307.639);
--muted-foreground: oklch(0.419 0.031 306.918);
--popover: oklch(0.982 0.01 325.168);
--popover-foreground: oklch(0.137 0.046 327.162);
--card: oklch(0.982 0.01 325.168);
--card-foreground: oklch(0.137 0.046 327.162);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.587 0.01 325.213);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.585 0.008 307.629);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.586 0.007 344.597);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.348 0.118 33.742);
--destructive-foreground: oklch(0.838 0.081 33.009);
--ring: oklch(0.587 0.01 325.213);
--chart-1: oklch(0.587 0.01 325.213);
--chart-2: oklch(0.585 0.008 307.629);
--chart-3: oklch(0.586 0.007 344.597);
--chart-4: oklch(0.611 0.008 307.64);
--chart-5: oklch(0.584 0.024 325.38);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.141 0.022 326.122);
--foreground: oklch(0.991 0.003 325.124);
--muted: oklch(0.195 0.017 306.742);
--muted-foreground: oklch(0.733 0.027 307.356);
--popover: oklch(0.141 0.022 326.122);
--popover-foreground: oklch(0.991 0.003 325.124);
--card: oklch(0.141 0.022 326.122);
--card-foreground: oklch(0.991 0.003 325.124);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.587 0.01 325.213);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.585 0.008 307.629);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.586 0.007 344.597);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.629 0.222 33.157);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.587 0.01 325.213);
--chart-1: oklch(0.587 0.01 325.213);
--chart-2: oklch(0.585 0.008 307.629);
--chart-3: oklch(0.586 0.007 344.597);
--chart-4: oklch(0.611 0.008 307.64);
--chart-5: oklch(0.584 0.024 325.38);
}