Why Kerf
A design system only helps if it's followed. Kerf makes the build follow it: values off the scale, text that fails contrast and fields without labels are errors, with the fix, before anything ships.
The problem
Every project starts with a spacing scale, a type scale and a palette. Then a deadline arrives, someone writes padding: 13px or a grey that's a shade too light, and nothing stops it. A year later the site has forty greys, the dark mode has text nobody can read, and the audit lists hundreds of contrast and label failures, found long after the code was written.
Most tools make the system easy to use. Kerf makes it the only thing you can use, and checks accessibility at the same time, because the compiler already knows each element's text colour and the background it sits on.
How it compares
-
Tailwind CSS
Good at: fast utility classes, a huge ecosystem, a theme you define once.
Kerf: no way out of the scale (Tailwind allows any value with
p-[13px]), contrast checked per element in light and dark mode, and accessibility errors in the build. -
Panda CSS
Good at: tokens, recipes and a strict mode that limits styles to your tokens, in CSS-in-JS.
Kerf: contrast and accessibility checks, plain HTML and server templates as well as components, and no JavaScript styling layer.
-
Style Dictionary
Good at: turning design tokens into variables for every platform.
Kerf: uses the tokens. It styles pages with them and checks that pages use only them.
-
axe, Lighthouse
Good at: thorough audits of a rendered page.
Kerf: runs at build time on every page, points at the file and line, and suggests the fix. Use both: Kerf can't see what your JavaScript adds later.
Who it's for
- Agencies building many client sites: one config per client gives each its own palette, dark mode and components, and every site is held to the same accessibility bar.
- Product teams whose UI drifts: new screens can't use values the system doesn't have, so they stay consistent without a review catching it.
- AI-assisted work: a coding agent gets a list of exact errors and fixes from
kerf check --jsoninstead of guessing what looks right.
When it isn't the right fit
- You want any value anywhere, with no system. Kerf will keep saying no.
- Your styles change with data at runtime:
s=is read at build time. You can still usek-classes in templates for what changes. - You need a large prebuilt component library. Kerf ships buttons, cards, alerts, badges, menus, dialogs, forms and prose, and you build the rest from recipes.
- Kerf is young (version 0.6) and changes quickly; see the changelog.
Try it
npm install --save-dev @kerfcss/kerf
npx kerf init
npx kerf build