Skip to content

Copybook, a shadcn/ui preset

Aqua with Hanken Grotesk, from an education theme. It comes from Copybook, one of our website themes.

Fonts: Hanken Grotesk · radius 0.875rem · light and dark · lowest text contrast 4.54:1

npx shadcn@latest add https://www.themes.dev/r/presets/copybook.json
Edit in the generator

Copybook on six free blocks from themes.dev UI. Scroll inside the preview.

The colours

The main variables, light and dark. The full set of 31 per mode, sidebar and charts included, is in the CSS below.

Light

  • background#f3f3f3
  • foreground#111316
  • primary#017e68
  • primary-foreground#ffffff
  • secondary#e8e8e4
  • muted-foreground#50555c
  • accent#e2f8f3
  • border#dddfe1
  • destructive#b42318
  • ring#111316
  • chart-1#34debf
  • chart-2#04ab91
  • chart-3#018a73
  • chart-4#006d5a
  • chart-5#005444

Dark

  • background#0f1114
  • foreground#ecedeb
  • primary#43e8c9
  • primary-foreground#111316
  • secondary#1e2126
  • muted-foreground#b1b7be
  • accent#16302b
  • border#2a2e34
  • destructive#ff9788
  • ring#43e8c9
  • chart-1#39e1c2
  • chart-2#06b89d
  • chart-3#02967f
  • chart-4#017662
  • chart-5#005d4c

Contrast, checked

Every pair shadcn/ui draws text with, measured as WCAG 2 contrast (AA needs 4.5:1) and APCA Lc (we ask 60 for text). Focus rings need 3:1 on the page.

WherePairLightDark
Body textforeground on background16.81:1 · Lc 9816.10:1 · Lc 95
Secondary text on the pagemuted-foreground on background6.78:1 · Lc 799.35:1 · Lc 63
Text in cardscard-foreground on card18.60:1 · Lc 10514.71:1 · Lc 95
Secondary text in cardsmuted-foreground on card7.50:1 · Lc 868.54:1 · Lc 62
Menus and popoverspopover-foreground on popover18.60:1 · Lc 10514.71:1 · Lc 95
Primary buttonsprimary-foreground on primary5.03:1 · Lc 8012.06:1 · Lc 78
Links and outline accentsprimary on background4.54:1 · Lc 6712.26:1 · Lc 78
Secondary buttonssecondary-foreground on secondary15.15:1 · Lc 9113.75:1 · Lc 94
Text on muted panelsmuted-foreground on muted6.11:1 · Lc 727.98:1 · Lc 61
Hovered menu itemsaccent-foreground on accent6.94:1 · Lc 7910.70:1 · Lc 84
Error messagesdestructive on background5.95:1 · Lc 749.02:1 · Lc 61
Sidebarsidebar-foreground on sidebar16.22:1 · Lc 9615.19:1 · Lc 95
Sidebar active itemsidebar-primary-foreground on sidebar-primary5.03:1 · Lc 8012.06:1 · Lc 78
Sidebar hoversidebar-accent-foreground on sidebar-accent15.15:1 · Lc 9113.75:1 · Lc 94
Focus ringring on background16.81:112.26:1

Use it

With the shadcn CLI, in a project set up with shadcn init:

npx shadcn@latest add https://www.themes.dev/r/presets/copybook.json

Or paste the CSS into globals.css (Next.js) or your main stylesheet (Vite, Astro), replacing the :root and .dark values that are there.

Then load the font:

npm i @fontsource-variable/hanken-grotesk

The registry item: themes.dev/r/presets/copybook.json. Free to use in any project.

globals.css
:root {
  --radius: 0.875rem;
  --background: oklch(0.965 0.001 106.42);
  --foreground: oklch(0.186 0.007 258.37);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.186 0.007 258.37);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.186 0.007 258.37);
  --primary: oklch(0.529 0.1 174.57);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.93 0.005 106.42);
  --secondary-foreground: oklch(0.186 0.007 258.37);
  --muted: oklch(0.93 0.005 106.42);
  --muted-foreground: oklch(0.448 0.013 256.75);
  --accent: oklch(0.962 0.024 180.65);
  --accent-foreground: oklch(0.433 0.077 177.41);
  --destructive: oklch(0.5 0.182 29.51);
  --border: oklch(0.903 0.003 247.86);
  --input: oklch(0.557 0.014 255.56);
  --ring: oklch(0.186 0.007 258.37);
  --chart-1: oklch(0.81 0.14 177.06);
  --chart-2: oklch(0.663 0.123 176.42);
  --chart-3: oklch(0.566 0.106 175.5);
  --chart-4: oklch(0.478 0.091 174.45);
  --chart-5: oklch(0.399 0.076 173.82);
  --sidebar: oklch(0.953 0.001 106.42);
  --sidebar-foreground: oklch(0.186 0.007 258.37);
  --sidebar-primary: oklch(0.529 0.1 174.57);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.93 0.005 106.42);
  --sidebar-accent-foreground: oklch(0.186 0.007 258.37);
  --sidebar-border: oklch(0.903 0.003 247.86);
  --sidebar-ring: oklch(0.186 0.007 258.37);
}

.dark {
  --background: oklch(0.177 0.007 258.37);
  --foreground: oklch(0.945 0.003 128.49);
  --card: oklch(0.221 0.009 255.61);
  --card-foreground: oklch(0.945 0.003 128.49);
  --popover: oklch(0.221 0.009 255.61);
  --popover-foreground: oklch(0.945 0.003 128.49);
  --primary: oklch(0.84 0.14 177.06);
  --primary-foreground: oklch(0.186 0.007 258.37);
  --secondary: oklch(0.247 0.011 258.37);
  --secondary-foreground: oklch(0.945 0.003 128.49);
  --muted: oklch(0.247 0.011 258.37);
  --muted-foreground: oklch(0.777 0.012 252.12);
  --accent: oklch(0.287 0.034 179.87);
  --accent-foreground: oklch(0.898 0.083 179.63);
  --destructive: oklch(0.781 0.128 29.18);
  --border: oklch(0.3 0.012 258.37);
  --input: oklch(0.618 0.014 255.55);
  --ring: oklch(0.84 0.14 177.06);
  --chart-1: oklch(0.82 0.14 177.06);
  --chart-2: oklch(0.7 0.129 177.06);
  --chart-3: oklch(0.603 0.112 176.37);
  --chart-4: oklch(0.506 0.095 175.33);
  --chart-5: oklch(0.428 0.081 174.51);
  --sidebar: oklch(0.207 0.007 258.37);
  --sidebar-foreground: oklch(0.945 0.003 128.49);
  --sidebar-primary: oklch(0.84 0.14 177.06);
  --sidebar-primary-foreground: oklch(0.186 0.007 258.37);
  --sidebar-accent: oklch(0.247 0.011 258.37);
  --sidebar-accent-foreground: oklch(0.945 0.003 128.49);
  --sidebar-border: oklch(0.3 0.012 258.37);
  --sidebar-ring: oklch(0.84 0.14 177.06);
}

@theme inline {
  --font-sans: "Hanken Grotesk Variable", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Hanken Grotesk Variable", "Hanken Grotesk", ui-sans-serif, system-ui, sans-serif;
}

The whole site

Copybook started as Copybook, a website theme

Copybook is a complete site for Course providers and colleges: every page, the content model and a live demo, built from the same blocks, in Astro and Next.js + Sanity. It comes with UI Pro, from €199 once, with every other theme.

More shadcn/ui presets

All 37 presets