Optimist is a shadcn/ui theme built around a neutral gray primary color (#656c67) with neutral gray accents (#656c6a). The light mode uses a neutral background (#f8fcf9). Dark mode keeps the neutral gray primary (#656c67) on a green-tinted background (#041007).
| Token | Light | Dark |
|---|---|---|
| Background | #f8fcf9mintcream | #041007black |
| Foreground | #030d05black | #f9fbf9mintcream |
| Card | #f8fcf9mintcream | #041007black |
| Card foreground | #030d05black | #f9fbf9mintcream |
| Popover | #f8fcf9mintcream | #041007black |
| Popover foreground | #030d05black | #f9fbf9mintcream |
| Primary | #656c67dimgray | #656c67dimgray |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #676c65dimgray | #676c65dimgray |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #f1f6efwhitesmoke | #0b1009black |
| Muted foreground | #404f3bdarkslategray | #b6c4b0silver |
| Accent | #656c6adimgray | #656c6adimgray |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #932810saddlebrown | #d83b18firebrick |
| Destructive foreground | #fbe0damistyrose | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #656c67dimgray | #656c67dimgray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.04:1 | AAA |
| Text on card | 19.04:1 | AAA |
| Primary button | 5.40:1 | AA |
| Secondary button | 5.38:1 | AA |
| Muted text | 7.96:1 | AAA |
| Accent | 5.38:1 | AA |
| Destructive | 6.57:1 | AA |
| Text on background | 18.64:1 | AAA |
| Text on card | 18.64:1 | AAA |
| Primary button | 5.40:1 | AA |
| Secondary button | 5.38:1 | AA |
| Muted text | 10.52:1 | AAA |
| Accent | 5.38:1 | AA |
| Destructive | 4.61:1 | AA |
Paste this into your globals.css to use Optimist in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.987 0.006 152.529);
--foreground: oklch(0.142 0.026 151.538);
--muted: oklch(0.967 0.01 136.641);
--muted-foreground: oklch(0.409 0.039 136.923);
--popover: oklch(0.987 0.006 152.529);
--popover-foreground: oklch(0.142 0.026 151.538);
--card: oklch(0.987 0.006 152.529);
--card-foreground: oklch(0.142 0.026 151.538);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.523 0.011 152.29);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.524 0.011 136.673);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.524 0.008 177.257);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.443 0.146 33.761);
--destructive-foreground: oklch(0.928 0.031 32.702);
--ring: oklch(0.523 0.011 152.29);
--chart-1: oklch(0.523 0.011 152.29);
--chart-2: oklch(0.524 0.011 136.673);
--chart-3: oklch(0.524 0.008 177.257);
--chart-4: oklch(0.551 0.012 136.673);
--chart-5: oklch(0.527 0.021 151.962);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.158 0.028 151.001);
--foreground: oklch(0.986 0.003 152.571);
--muted: oklch(0.166 0.016 136.893);
--muted-foreground: oklch(0.805 0.033 136.734);
--popover: oklch(0.158 0.028 151.001);
--popover-foreground: oklch(0.986 0.003 152.571);
--card: oklch(0.158 0.028 151.001);
--card-foreground: oklch(0.986 0.003 152.571);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.523 0.011 152.29);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.524 0.011 136.673);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.524 0.008 177.257);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.585 0.198 33.564);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.523 0.011 152.29);
--chart-1: oklch(0.523 0.011 152.29);
--chart-2: oklch(0.524 0.011 136.673);
--chart-3: oklch(0.524 0.008 177.257);
--chart-4: oklch(0.551 0.012 136.673);
--chart-5: oklch(0.527 0.021 151.962);
}