Textbook is a shadcn/ui theme built around a vivid deep yellow primary color (#888601) with vivid deep green accents (#478801). The light mode uses a neutral background (#ffffff). Dark mode keeps the vivid deep yellow primary (#888601) on a yellow-tinted background (#0e0e07).
| Token | Light | Dark |
|---|---|---|
| Background | #ffffffwhite | #0e0e07black |
| Foreground | #080803black | #fdfdfcwhite |
| Card | #fcfcfcsnow | #111108black |
| Card foreground | #040401black | #ffffffwhite |
| Popover | #fcfcfcsnow | #111108black |
| Popover foreground | #040401black | #ffffffwhite |
| Primary | #888601olive | #888601olive |
| Primary foreground | #ffffffwhite | #ffffffwhite |
| Secondary | #884301saddlebrown | #884301saddlebrown |
| Secondary foreground | #ffffffwhite | #ffffffwhite |
| Muted | #ece0d4antiquewhite | #2b1e13black |
| Muted foreground | #504a44darkslategray | #bbb5afsilver |
| Accent | #478801forestgreen | #478801forestgreen |
| Accent foreground | #ffffffwhite | #ffffffwhite |
| Destructive | #ba4c0dchocolate | #d7580fchocolate |
| Destructive foreground | #ffffffwhite | #ffffffwhite |
| Border | #e5e7eblavender | #1f2937darkslategray |
| Input | #e5e7eblavender | #1f2937darkslategray |
| Ring | #888601olive | #888601olive |
WCAG 2 contrast ratios between each background and its foreground color.
| Text on background | 20.06:1 | AAA |
| Text on card | 20.08:1 | AAA |
| Primary button | 3.84:1 | AA Large |
| Secondary button | 7.37:1 | AAA |
| Muted text | 6.73:1 | AA |
| Accent | 4.36:1 | AA Large |
| Destructive | 5.07:1 | AA |
| Text on background | 19.05:1 | AAA |
| Text on card | 18.92:1 | AAA |
| Primary button | 3.84:1 | AA Large |
| Secondary button | 7.37:1 | AAA |
| Muted text | 7.96:1 | AAA |
| Accent | 4.36:1 | AA Large |
| Destructive | 3.97:1 | AA Large |
Paste this into your globals.css to use Textbook in your shadcn/ui project.
:root {
--radius: 0.5rem;
--background: oklch(1 0 180);
--foreground: oklch(0.129 0.016 107.788);
--muted: oklch(0.913 0.021 65.692);
--muted-foreground: oklch(0.412 0.012 65.592);
--popover: oklch(0.992 0 161.565);
--popover-foreground: oklch(0.103 0.013 107.788);
--card: oklch(0.992 0 161.565);
--card-foreground: oklch(0.103 0.013 107.788);
--border: oklch(0.928 0.006 264.531);
--input: oklch(0.928 0.006 264.531);
--primary: oklch(0.603 0.13 108.555);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.462 0.115 53.676);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.562 0.163 134.686);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.555 0.156 43.923);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.603 0.13 108.555);
--chart-1: oklch(0.603 0.13 108.555);
--chart-2: oklch(0.462 0.115 53.676);
--chart-3: oklch(0.562 0.163 134.686);
--chart-4: oklch(0.497 0.125 53.205);
--chart-5: oklch(0.609 0.132 108.55);
}
.dark {
--radius: 0.5rem;
--background: oklch(0.16 0.015 107.224);
--foreground: oklch(0.994 0.002 105.649);
--muted: oklch(0.248 0.028 64.048);
--muted-foreground: oklch(0.776 0.011 65.802);
--popover: oklch(0.175 0.018 107.269);
--popover-foreground: oklch(1 0 180);
--card: oklch(0.175 0.018 107.269);
--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.603 0.13 108.555);
--primary-foreground: oklch(1 0 180);
--secondary: oklch(0.462 0.115 53.676);
--secondary-foreground: oklch(1 0 180);
--accent: oklch(0.562 0.163 134.686);
--accent-foreground: oklch(1 0 180);
--destructive: oklch(0.616 0.175 43.648);
--destructive-foreground: oklch(1 0 180);
--ring: oklch(0.603 0.13 108.555);
--chart-1: oklch(0.603 0.13 108.555);
--chart-2: oklch(0.462 0.115 53.676);
--chart-3: oklch(0.562 0.163 134.686);
--chart-4: oklch(0.497 0.125 53.205);
--chart-5: oklch(0.609 0.132 108.55);
}