Rare is a shadcn/ui theme built around a deep yellow primary color (#5a5f1c) with deep indigo accents (#201c5f). The light mode uses a neutral background (#ffffff). Dark mode keeps the deep yellow primary (#5a5f1c) on a yellow-tinted background (#0c0c03).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #0c0c03black |
| Foreground | #080901black | #ffffffwhite |
| Card | #ffffffwhite | #0c0c03black |
| Card foreground | #080901black | #ffffffwhite |
| Popover | #ffffffwhite | #0c0c03black |
| Popover foreground | #080901black | #ffffffwhite |
| Primary | #5a5f1cdarkolivegreen | #5a5f1cdarkolivegreen |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #201c5fmidnightblue | #201c5fmidnightblue |
| Secondary foreground | #c3c0edlightsteelblue | #c3c0edlightsteelblue |
| Muted | #e6e5f0lavender | #100f1ablack |
| Muted foreground | #616161dimgray | #9e9e9edarkgray |
| Accent | #201c5fmidnightblue | #201c5fmidnightblue |
| Accent foreground | #c3c0edlightsteelblue | #c3c0edlightsteelblue |
| Destructive | #b14310sienna | #ec7036tomato |
| Destructive foreground | #ffffffwhite | #000000black |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #5a5f1cdarkolivegreen | #5a5f1cdarkolivegreen |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.00:1 | AAA |
| Text on card | 20.00:1 | AAA |
| Primary button | 6.80:1 | AA |
| Secondary button | 8.70:1 | AAA |
| Muted text | 4.97:1 | AA |
| Accent | 8.70:1 | AAA |
| Destructive | 5.67:1 | AA |
| Text on background | 19.62:1 | AAA |
| Text on card | 19.62:1 | AAA |
| Primary button | 6.80:1 | AA |
| Secondary button | 8.70:1 | AAA |
| Muted text | 7.09:1 | AAA |
| Accent | 8.70:1 | AAA |
| Destructive | 6.94:1 | AA |
Paste this into your globals.css to use Rare in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.135 0.024 111.532);
--muted: oklch(0.926 0.014 289.188);
--muted-foreground: oklch(0.492 0 180);
--popover: oklch(1 0 180);
--popover-foreground: oklch(0.135 0.024 111.532);
--card: oklch(1 0 180);
--card-foreground: oklch(0.135 0.024 111.532);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.467 0.089 113.042);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.279 0.115 278.867);
--secondary-foreground: oklch(0.824 0.063 287.996);
--accent: oklch(0.279 0.115 278.867);
--accent-foreground: oklch(0.824 0.063 287.996);
--destructive: oklch(0.529 0.154 40.949);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.467 0.089 113.042);
--chart-1: oklch(0.467 0.089 113.042);
--chart-2: oklch(0.279 0.115 278.867);
--chart-3: oklch(0.279 0.115 278.867);
--chart-4: oklch(0.3 0.127 278.531);
--chart-5: oklch(0.473 0.092 113.153);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.151 0.022 111.446);
--foreground: oklch(1 0 180);
--muted: oklch(0.175 0.022 286.973);
--muted-foreground: oklch(0.7 0 180);
--popover: oklch(0.151 0.022 111.446);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.151 0.022 111.446);
--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.467 0.089 113.042);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.279 0.115 278.867);
--secondary-foreground: oklch(0.824 0.063 287.996);
--accent: oklch(0.279 0.115 278.867);
--accent-foreground: oklch(0.824 0.063 287.996);
--destructive: oklch(0.684 0.169 43.281);
--destructive-foreground: oklch(0 0 0);
--ring: oklch(0.467 0.089 113.042);
--chart-1: oklch(0.467 0.089 113.042);
--chart-2: oklch(0.279 0.115 278.867);
--chart-3: oklch(0.279 0.115 278.867);
--chart-4: oklch(0.3 0.127 278.531);
--chart-5: oklch(0.473 0.092 113.153);
}