I am happy to announce the release of tw 1.1.0 (available on brew already and soon in opam).
$ brew install samoht/tap/tw
$ opam install tw.1.1.0
tw is an implementation of Tailwind CSS v4 in pure OCaml. This is the first version I would advise people to use: the previous ones only partially supported some features, and it was unclear where things were breaking. The 1.1.0 release now covers all the Tailwind v4 utilities, variants and official plugins, and more importantly it comes with a proper, mechanical way to check that its output has no visual difference from Tailwind’s.
tw now comes with a CLI that is a drop-in replacement for the Tailwind CLI. It builds whole Tailwind projects from their CSS entrypoint (tw -i src/app.css -o dist/app.css), including @theme, @source, @apply, custom utilities and variants, and the typography and forms plugins, without Node.js. It works for any project configured in CSS, whatever language generates the HTML.
If you are using OCaml you can directly use an OCaml API with Tw_html that lets you build HTML components carrying their own styles. It exposes htmlit’s API but attaches tw classes to every node so you can query what CSS a given HTML fragment needs to be displayed.
You can read more about the process to get to this release in my blog post. Feedback greatly appreciated in the issue tracker or in DMs!