twl

Write long Tailwind class names across several lines, with comments, and pay nothing for it at runtime.

What you write
What ships

Newlines and comments

Group class names the way you think about them, annotate the groups, and let the compiler fold it all into one string.

Nothing left at runtime

A static template becomes a string literal. A static tw template has its tailwind-merge resolved at build time too.

Works without the plugin

The macro entry exports the real runtime, so tests and scripts keep working. Only the cost differs.

Every bundler

Vite, Rollup, Rolldown, webpack, Rspack, esbuild and Farm through unplugin — and Turbopack through its own loader.

This page is built with twl and best-i18n. Every class name on it was folded at build time, and every string above was inlined for this locale.