Skip to content

Counterfoil, a shadcn/ui preset

Hot magenta with Arimo, from a ticketing theme. It comes from Counterfoil, one of our website themes.

Fonts: Arimo · radius 0.75rem · light and dark · lowest text contrast 4.53:1

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

Counterfoil 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#f3f3f1
  • foreground#1c1c1c
  • primary#cf00a5
  • primary-foreground#ffffff
  • secondary#e8e8e3
  • muted-foreground#545452
  • accent#ffe0f4
  • border#dcdcd8
  • destructive#b42318
  • ring#1c1c1c
  • chart-1#ff8fe5
  • chart-2#f228c4
  • chart-3#c701a0
  • chart-4#a10080
  • chart-5#7f0064

Dark

  • background#141414
  • foreground#ededeb
  • primary#ff8be4
  • primary-foreground#1c1c1c
  • secondary#262324
  • muted-foreground#b7b7b3
  • accent#381a32
  • border#313131
  • destructive#ff9788
  • ring#ededeb
  • chart-1#ff95e6
  • chart-2#ff3cd1
  • chart-3#d521ac
  • chart-4#ac0089
  • chart-5#8a006d

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 background15.42:1 · Lc 9715.75:1 · Lc 95
Secondary text on the pagemuted-foreground on background6.87:1 · Lc 799.18:1 · Lc 63
Text in cardscard-foreground on card17.06:1 · Lc 10414.24:1 · Lc 94
Secondary text in cardsmuted-foreground on card7.60:1 · Lc 868.31:1 · Lc 62
Menus and popoverspopover-foreground on popover17.06:1 · Lc 10414.24:1 · Lc 94
Primary buttonsprimary-foreground on primary5.01:1 · Lc 778.19:1 · Lc 62
Links and outline accentsprimary on background4.53:1 · Lc 658.85:1 · Lc 61
Secondary buttonssecondary-foreground on secondary13.90:1 · Lc 9013.25:1 · Lc 93
Text on muted panelsmuted-foreground on muted6.19:1 · Lc 737.73:1 · Lc 61
Hovered menu itemsaccent-foreground on accent7.46:1 · Lc 759.44:1 · Lc 72
Error messagesdestructive on background5.95:1 · Lc 748.79:1 · Lc 61
Sidebarsidebar-foreground on sidebar14.88:1 · Lc 9514.75:1 · Lc 95
Sidebar active itemsidebar-primary-foreground on sidebar-primary5.01:1 · Lc 778.19:1 · Lc 62
Sidebar hoversidebar-accent-foreground on sidebar-accent13.90:1 · Lc 9013.25:1 · Lc 93
Focus ringring on background15.42:115.75: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/counterfoil.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/arimo

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

globals.css
:root {
  --radius: 0.75rem;
  --background: oklch(0.965 0.003 106.45);
  --foreground: oklch(0.226 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.226 0 0);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.226 0 0);
  --primary: oklch(0.576 0.25 340.38);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.93 0.007 106.45);
  --secondary-foreground: oklch(0.226 0 0);
  --muted: oklch(0.93 0.007 106.45);
  --muted-foreground: oklch(0.445 0.003 106.53);
  --accent: oklch(0.938 0.043 338.98);
  --accent-foreground: oklch(0.428 0.186 339.54);
  --destructive: oklch(0.5 0.182 29.51);
  --border: oklch(0.893 0.005 106.51);
  --input: oklch(0.571 0.006 106.59);
  --ring: oklch(0.226 0 0);
  --chart-1: oklch(0.796 0.169 336.43);
  --chart-2: oklch(0.66 0.267 340.01);
  --chart-3: oklch(0.56 0.243 340.02);
  --chart-4: oklch(0.479 0.208 340.37);
  --chart-5: oklch(0.401 0.174 340.55);
  --sidebar: oklch(0.953 0.003 106.45);
  --sidebar-foreground: oklch(0.226 0 0);
  --sidebar-primary: oklch(0.576 0.25 340.38);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.93 0.007 106.45);
  --sidebar-accent-foreground: oklch(0.226 0 0);
  --sidebar-border: oklch(0.893 0.005 106.51);
  --sidebar-ring: oklch(0.226 0 0);
}

.dark {
  --background: oklch(0.191 0 0);
  --foreground: oklch(0.946 0.003 106.45);
  --card: oklch(0.235 0 0);
  --card-foreground: oklch(0.946 0.003 106.45);
  --popover: oklch(0.235 0 0);
  --popover-foreground: oklch(0.946 0.003 106.45);
  --primary: oklch(0.791 0.174 336.52);
  --primary-foreground: oklch(0.226 0 0);
  --secondary: oklch(0.261 0.004 0);
  --secondary-foreground: oklch(0.946 0.003 106.45);
  --muted: oklch(0.261 0.004 0);
  --muted-foreground: oklch(0.779 0.006 106.54);
  --accent: oklch(0.271 0.06 335.99);
  --accent-foreground: oklch(0.855 0.112 337.1);
  --destructive: oklch(0.781 0.128 29.18);
  --border: oklch(0.313 0 0);
  --input: oklch(0.592 0.006 106.58);
  --ring: oklch(0.946 0.003 106.45);
  --chart-1: oklch(0.806 0.16 336.22);
  --chart-2: oklch(0.698 0.266 339.72);
  --chart-3: oklch(0.6 0.244 340.01);
  --chart-4: oklch(0.502 0.218 340.08);
  --chart-5: oklch(0.428 0.186 340.38);
  --sidebar: oklch(0.221 0 0);
  --sidebar-foreground: oklch(0.946 0.003 106.45);
  --sidebar-primary: oklch(0.791 0.174 336.52);
  --sidebar-primary-foreground: oklch(0.226 0 0);
  --sidebar-accent: oklch(0.261 0.004 0);
  --sidebar-accent-foreground: oklch(0.946 0.003 106.45);
  --sidebar-border: oklch(0.313 0 0);
  --sidebar-ring: oklch(0.946 0.003 106.45);
}

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

The whole site

Counterfoil started as Counterfoil, a website theme

Counterfoil is a complete site for Charities and food bank networks: 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