wind
Build-time, Tailwind CSS v4.3.0-compatible utility-CSS compiler. Pure Rust, std-only, zero
external crates. No Node, no PostCSS at runtime.
A clean-room reimplementation, not a port: the engine is written from observed behaviour plus a golden fixture suite captured from the real Tailwind engine as a conformance oracle, never transcribed from Tailwind's source. Feed it a stylesheet and a set of class-name candidates; it returns the generated CSS.
// one-shot
letcss=reperfect_wind::compile(r#"@import "wind";"#,["flex","bg-red-500"]).unwrap();// two-phase: parse once, generate many (watch mode)
letcompiler=reperfect_wind::Compiler::from_stylesheet(r#"@import "wind";"#).unwrap();letcss=compiler.generate(["flex","md:hover:p-4"]).unwrap();Typically consumed from a build.rs: generate the CSS during cargo build and embed it with
include_str!.
Status
In progress. wind targets byte-exact parity with Tailwind v4.3.0, measured against two oracle-captured corpora (never hand-edited):
- golden: 188 hand-picked cases, always green, fast smoke set.
- corpus: the compatibility gate auto-derived from Tailwind's own
*.test.ts. Still RED (1512/1875in-scope pass,33/43reject). That red set is the completion backlog.
Still stub (loud todo!(), outside compile()): @import inlining, v3 compat, source-maps,
Scanner (candidate extraction from source files).
Build & test
cargo test # golden suite + unit, must be green
cargo clippy --all-targets -- -D warnings # zero warnings
cargo test --test corpus -- --ignored # the RED compatibility gate
node scripts/corpus/cluster.mjs # rank the red set by root cause
Regenerating fixtures/corpus needs a Tailwind v4.3.0 clone at ~/LocalDocuments/tailwind (see
SYNC.md, TAILWIND_VERSION).
Docs
SPEC.md: the contract. Agreed-spec checklist, threat model, module map, fidelity rule.API.md: the frozen public seam.SYNC.md: how the two corpora are captured, and how to bump the pinned Tailwind version.AGENTS.md: how agents work in this repo.
License
0BSD OR Apache-2.0 WITH LLVM-exception OR CC0-1.0 OR MIT OR Unlicense; pick your poison.
Part of reperfect; independent, clean-room.