Kerf for VS Code
Kerf checks your design system and accessibility when you build. This extension shows the same checks as you type.
- Checks as you type: off-scale values, WCAG contrast in light and dark mode, small tap targets, fields without labels, images without alt or size, and the rest of
kerf check, underlined where they are. Unsaved changes are checked too, including partials through the pages that include them.
- One-click fixes:
pad 13 → pad 12 or pad 16, a typo to the word it meant, a text colour that fails contrast to the one that passes.
- Completion in
s="…": words, scale values, colour roles (with swatches), component variants and breakpoints, from your own kerf.config.js.
- CSS on hover: what an item turns into, exactly as a build writes it, and a role's light and dark colours.
Works in HTML, PHP, Blade, Twig, Nunjucks, Liquid, ERB, EJS, Handlebars, Vue, Svelte, Astro, JSX/TSX and your own .css files.
Requirements
A project with kerf.config.js and @kerfcss/kerf 0.5.0 or later installed:
npm install --save-dev @kerfcss/kerf
npx kerf init
The extension runs your project's own Kerf (kerf lsp), so the editor reports exactly what your build does. After updating Kerf, run Kerf: Restart from the command palette.
Other editors
kerf lsp is a standard language server over stdin and stdout. Point any editor with LSP support at npx kerf lsp for the file types above.
Docs · Source