Elementary is a shadcn/ui theme built around a near-black primary color (#0a0a0a) with near-black accents (#0a0a0a). The light mode uses a neutral background (#ffffff). Dark mode keeps the near-black primary (#0a0a0a) on a neutral background (#010304).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #010304black |
| Foreground | #051114black | #fcfdfdwhite |
| Card | #fcfcfcsnow | #030708black |
| Card foreground | #040e10black | #ffffffwhite |
| Popover | #fcfcfcsnow | #030708black |
| Popover foreground | #040e10black | #ffffffwhite |
| Primary | #0a0a0ablack | #0a0a0ablack |
| Primary foreground | #a1a4a5darkgray | #a1a4a5darkgray |
| Secondary | #0a0a0ablack | #0a0a0ablack |
| Secondary foreground | #a5a2a1darkgray | #a5a2a1darkgray |
| Muted | #f1efeewhitesmoke | #110e0eblack |
| Muted foreground | #544440darkslategray | #bfafabdarkgray |
| Accent | #0a0a0ablack | #0a0a0ablack |
| Accent foreground | #a5a2a1darkgray | #a5a2a1darkgray |
| Destructive | #8f2d00saddlebrown | #ff5100orangered |
| Destructive foreground | #ffd5c2peachpuff | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #0a0a0ablack | #0a0a0ablack |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.14:1 | AAA |
| Text on card | 19.10:1 | AAA |
| Primary button | 7.87:1 | AAA |
| Secondary button | 7.80:1 | AAA |
| Muted text | 8.03:1 | AAA |
| Accent | 7.80:1 | AAA |
| Destructive | 6.11:1 | AA |
| Text on background | 20.24:1 | AAA |
| Text on card | 20.27:1 | AAA |
| Primary button | 7.87:1 | AAA |
| Secondary button | 7.80:1 | AAA |
| Muted text | 9.07:1 | AAA |
| Accent | 7.80:1 | AAA |
| Destructive | 3.27:1 | AA Large |
Paste this into your globals.css to use Elementary in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.169 0.019 212.796);
--muted: oklch(0.953 0.003 32.661);
--muted-foreground: oklch(0.401 0.023 32.785);
--popover: oklch(0.992 0 161.565);
--popover-foreground: oklch(0.154 0.017 211.612);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.154 0.017 211.612);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.146 0.001 212.775);
--primary-foreground: oklch(0.718 0.004 212.665);
--secondary: oklch(0.146 0.001 32.756);
--secondary-foreground: oklch(0.715 0.004 32.661);
--accent: oklch(0.146 0.001 32.756);
--accent-foreground: oklch(0.715 0.004 32.661);
--destructive: oklch(0.441 0.14 39.446);
--destructive-foreground: oklch(0.904 0.054 46.277);
--ring: oklch(0.146 0.001 212.775);
--chart-1: oklch(0.146 0.001 212.775);
--chart-2: oklch(0.146 0.001 32.756);
--chart-3: oklch(0.146 0.001 32.756);
--chart-4: oklch(0.181 0.001 32.661);
--chart-5: oklch(0.146 0.001 212.659);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.095 0.009 209.198);
--foreground: oklch(0.993 0.001 212.662);
--muted: oklch(0.168 0.004 32.685);
--muted-foreground: oklch(0.766 0.019 32.682);
--popover: oklch(0.12 0.011 209.198);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.12 0.011 209.198);
--card-foreground: oklch(1 0 180);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.146 0.001 212.775);
--primary-foreground: oklch(0.718 0.004 212.665);
--secondary: oklch(0.146 0.001 32.756);
--secondary-foreground: oklch(0.715 0.004 32.661);
--accent: oklch(0.146 0.001 32.756);
--accent-foreground: oklch(0.715 0.004 32.661);
--destructive: oklch(0.671 0.221 37.808);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.146 0.001 212.775);
--chart-1: oklch(0.146 0.001 212.775);
--chart-2: oklch(0.146 0.001 32.756);
--chart-3: oklch(0.146 0.001 32.756);
--chart-4: oklch(0.181 0.001 32.661);
--chart-5: oklch(0.146 0.001 212.659);
}