Petal is a shadcn/ui theme built around a muted yellow primary color (#9c916d) with muted light yellow accents (#d9d6ce). The light mode uses a neutral background (#ffffff). Dark mode keeps the muted yellow primary (#9c916d) on a yellow-tinted background (#0c0a04).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #0c0a04black |
| Foreground | #000000black | #ffffffwhite |
| Card | #ffffffwhite | #0c0a04black |
| Card foreground | #000000black | #ffffffwhite |
| Popover | #ffffffwhite | #0c0a04black |
| Popover foreground | #000000black | #ffffffwhite |
| Primary | #9c916dgray | #9c916dgray |
| Primary foreground | #000000black | #000000black |
| Secondary | #d9d6celightgrey | #37342adarkslategray |
| Secondary foreground | #423e34darkslategray | #d1cdc2lightgrey |
| Muted | #dddcd9gainsboro | #262522darkslategray |
| Muted foreground | #585341darkolivegreen | #beb9a7silver |
| Accent | #d9d6celightgrey | #37342adarkslategray |
| Accent foreground | #423e34darkslategray | #d1cdc2lightgrey |
| Destructive | #8b1d04darkred | #f95834tomato |
| Destructive foreground | #fdcec4pink | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #9c916dgray | #9c916dgray |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 21.00:1 | AAA |
| Text on card | 21.00:1 | AAA |
| Primary button | 6.68:1 | AA |
| Secondary button | 7.36:1 | AAA |
| Muted text | 5.63:1 | AA |
| Accent | 7.36:1 | AAA |
| Destructive | 6.53:1 | AA |
| Text on background | 19.81:1 | AAA |
| Text on card | 19.81:1 | AAA |
| Primary button | 6.68:1 | AA |
| Secondary button | 7.82:1 | AAA |
| Muted text | 7.81:1 | AAA |
| Accent | 7.82:1 | AAA |
| Destructive | 6.47:1 | AA |
Paste this into your globals.css to use Petal in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0 0 0);
--muted: oklch(0.896 0.005 92.707);
--muted-foreground: oklch(0.441 0.028 93.125);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0 0 0);
--card: oklch(1 0 180);
--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.657 0.052 93.163);
--primary-foreground: oklch(0 0 0);
--secondary: oklch(0.877 0.011 92.779);
--secondary-foreground: oklch(0.365 0.018 93.059);
--accent: oklch(0.877 0.011 92.779);
--accent-foreground: oklch(0.365 0.018 93.059);
--destructive: oklch(0.416 0.148 33.236);
--destructive-foreground: oklch(0.89 0.055 32.813);
--ring: oklch(0.657 0.052 93.163);
--chart-1: oklch(0.657 0.052 93.163);
--chart-2: oklch(0.877 0.011 92.779);
--chart-3: oklch(0.877 0.011 92.779);
--chart-4: oklch(0.899 0.009 92.755);
--chart-5: oklch(0.664 0.059 93.17);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.144 0.017 96.718);
--foreground: oklch(1 0 180);
--muted: oklch(0.264 0.006 92.872);
--muted-foreground: oklch(0.784 0.025 92.939);
--popover: oklch(0.144 0.017 96.718);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.144 0.017 96.718);
--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.657 0.052 93.163);
--primary-foreground: oklch(0 0 0);
--secondary: oklch(0.325 0.018 93.088);
--secondary-foreground: oklch(0.849 0.016 92.835);
--accent: oklch(0.325 0.018 93.088);
--accent-foreground: oklch(0.849 0.016 92.835);
--destructive: oklch(0.672 0.203 34.083);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.657 0.052 93.163);
--chart-1: oklch(0.657 0.052 93.163);
--chart-2: oklch(0.325 0.018 93.088);
--chart-3: oklch(0.325 0.018 93.088);
--chart-4: oklch(0.357 0.021 93.096);
--chart-5: oklch(0.664 0.059 93.17);
}