Alfalfa is a shadcn/ui theme built around a muted green primary color (#7ca178) with muted purple accents (#9c78a1). The light mode uses a neutral background (#f7fdf6). Dark mode keeps the muted green primary (#7ca178) on a green-tinted background (#070f06).
| Token | Light | Dark |
|---|---|---|
| Background | #f7fdf6mintcream | #070f06black |
| Foreground | #061603black | #fcfdfcwhite |
| Card | #f7fdf6mintcream | #070f06black |
| Card foreground | #061603black | #fcfdfcwhite |
| Popover | #f7fdf6mintcream | #070f06black |
| Popover foreground | #061603black | #fcfdfcwhite |
| Primary | #7ca178gray | #7ca178gray |
| Primary foreground | #000000black | #000000black |
| Secondary | #9c78a1lightslategray | #9c78a1lightslategray |
| Secondary foreground | #000000black | #000000black |
| Muted | #e3dde4gainsboro | #211b22black |
| Muted foreground | #58495bdimgray | #b4a4b6darkgray |
| Accent | #9c78a1lightslategray | #9c78a1lightslategray |
| Accent foreground | #000000black | #000000black |
| Destructive | #86220esaddlebrown | #e94e2ftomato |
| Destructive foreground | #fad4ccbisque | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #7ca178gray | #7ca178gray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 18.14:1 | AAA |
| Text on card | 18.14:1 | AAA |
| Primary button | 7.22:1 | AAA |
| Secondary button | 5.59:1 | AA |
| Muted text | 6.24:1 | AA |
| Accent | 5.59:1 | AA |
| Destructive | 6.83:1 | AA |
| Text on background | 19.10:1 | AAA |
| Text on card | 19.10:1 | AAA |
| Primary button | 7.22:1 | AAA |
| Secondary button | 5.59:1 | AA |
| Muted text | 7.15:1 | AAA |
| Accent | 5.59:1 | AA |
| Destructive | 3.74:1 | AA Large |
Paste this into your globals.css to use Alfalfa in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(0.989 0.011 142.075);
--foreground: oklch(0.18 0.046 140.402);
--muted: oklch(0.904 0.011 322.155);
--muted-foreground: oklch(0.427 0.036 322.385);
--popover: oklch(0.989 0.011 142.075);
--popover-foreground: oklch(0.18 0.046 140.402);
--card: oklch(0.989 0.011 142.075);
--card-foreground: oklch(0.18 0.046 140.402);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.67 0.072 141.742);
--primary-foreground: oklch(0 0 0);
--secondary: oklch(0.621 0.074 322.493);
--secondary-foreground: oklch(0 0 0);
--accent: oklch(0.621 0.074 322.493);
--accent-foreground: oklch(0 0 0);
--destructive: oklch(0.412 0.138 33.017);
--destructive-foreground: oklch(0.899 0.044 31.217);
--ring: oklch(0.67 0.072 141.742);
--chart-1: oklch(0.67 0.072 141.742);
--chart-2: oklch(0.621 0.074 322.493);
--chart-3: oklch(0.621 0.074 322.493);
--chart-4: oklch(0.647 0.069 322.454);
--chart-5: oklch(0.676 0.083 141.689);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.155 0.024 140.949);
--foreground: oklch(0.993 0.002 142.107);
--muted: oklch(0.233 0.016 322.333);
--muted-foreground: oklch(0.739 0.031 322.254);
--popover: oklch(0.155 0.024 140.949);
--popover-foreground: oklch(0.993 0.002 142.107);
--card: oklch(0.155 0.024 140.949);
--card-foreground: oklch(0.993 0.002 142.107);
--border: oklch(0.278 0.03 256.848);
--input: oklch(0.278 0.03 256.848);
--primary: oklch(0.67 0.072 141.742);
--primary-foreground: oklch(0 0 0);
--secondary: oklch(0.621 0.074 322.493);
--secondary-foreground: oklch(0 0 0);
--accent: oklch(0.621 0.074 322.493);
--accent-foreground: oklch(0 0 0);
--destructive: oklch(0.635 0.196 33.201);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.67 0.072 141.742);
--chart-1: oklch(0.67 0.072 141.742);
--chart-2: oklch(0.621 0.074 322.493);
--chart-3: oklch(0.621 0.074 322.493);
--chart-4: oklch(0.647 0.069 322.454);
--chart-5: oklch(0.676 0.083 141.689);
}