Optimal is a shadcn/ui theme built around a green primary color (#99cb43) with violet accents (#7543cb). The light mode uses a neutral background (#fafcf8). Dark mode keeps the green primary (#99cb43) on a neutral background (#000000).
| Token | Light | Dark |
|---|---|---|
| Background | #fafcf8snow | #000000black |
| Foreground | #030401black | #fdfdfcwhite |
| Card | #f8fbf4whitesmoke | #030303black |
| Card foreground | #000000black | #ffffffwhite |
| Popover | #f8fbf4whitesmoke | #030303black |
| Popover foreground | #000000black | #ffffffwhite |
| Primary | #99cb43yellowgreen | #99cb43yellowgreen |
| Primary foreground | #26340edarkgreen | #26340edarkgreen |
| Secondary | #7543cbslateblue | #7543cbslateblue |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #efebf4whitesmoke | #0e0b14black |
| Muted foreground | #564f64dimgray | #a39bb0darkgray |
| Accent | #7543cbslateblue | #7543cbslateblue |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #7c2804saddlebrown | #f75008orangered |
| Destructive foreground | #fdcab5peachpuff | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #99cb43yellowgreen | #99cb43yellowgreen |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 19.94:1 | AAA |
| Text on card | 20.06:1 | AAA |
| Primary button | 6.98:1 | AA |
| Secondary button | 6.13:1 | AA |
| Muted text | 6.63:1 | AA |
| Accent | 6.13:1 | AA |
| Destructive | 6.63:1 | AA |
| Text on background | 20.63:1 | AAA |
| Text on card | 20.67:1 | AAA |
| Primary button | 6.98:1 | AA |
| Secondary button | 6.13:1 | AA |
| Muted text | 7.31:1 | AAA |
| Accent | 6.13:1 | AA |
| Destructive | 3.43:1 | AA Large |
Paste this into your globals.css to use Optimal in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.989 0.006 123.024);
--foreground: oklch(0.101 0.015 122.414);
--muted: oklch(0.946 0.012 302.737);
--muted-foreground: oklch(0.442 0.036 301.681);
--popover: oklch(0.984 0.009 123.072);
--popover-foreground: oklch(0 0 0);
--card: oklch(0.984 0.009 123.072);
--card-foreground: oklch(0 0 0);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.782 0.172 127.364);
--primary-foreground: oklch(0.303 0.062 126.838);
--secondary: oklch(0.517 0.2 295.335);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.517 0.2 295.335);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.4 0.124 39.343);
--destructive-foreground: oklch(0.879 0.065 44.385);
--ring: oklch(0.782 0.172 127.364);
--chart-1: oklch(0.782 0.172 127.364);
--chart-2: oklch(0.517 0.2 295.335);
--chart-3: oklch(0.517 0.2 295.335);
--chart-4: oklch(0.545 0.189 296.487);
--chart-5: oklch(0.791 0.178 127.585);
}
.dark {
--radius: 0.5rem;
--background: oklch(0 0 0);
--foreground: oklch(0.993 0.001 122.945);
--muted: oklch(0.158 0.019 301.112);
--muted-foreground: oklch(0.703 0.032 302.234);
--popover: oklch(0.092 0 180);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.092 0 180);
--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.782 0.172 127.364);
--primary-foreground: oklch(0.303 0.062 126.838);
--secondary: oklch(0.517 0.2 295.335);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.517 0.2 295.335);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.658 0.214 37.723);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.782 0.172 127.364);
--chart-1: oklch(0.782 0.172 127.364);
--chart-2: oklch(0.517 0.2 295.335);
--chart-3: oklch(0.517 0.2 295.335);
--chart-4: oklch(0.545 0.189 296.487);
--chart-5: oklch(0.791 0.178 127.585);
}