tailwindcss/packages
Aaron Tinio aaaefe8b5d
Add --stream flag to canonicalize subcommand (#19796)
## Summary

- Adds `--stream` flag to `tailwindcss canonicalize` that reads
candidate groups from stdin line by line and writes canonicalized
results to stdout
- Keeps the design system loaded across requests, making it suitable as
a long-running sidecar process
- Empty lines pass through, keeping request/response pairs aligned

## Motivation

Non-JS tools (formatters, editor plugins, etc.) currently have no
lightweight way to canonicalize Tailwind classes. The existing batch
mode works for one-off use, but tools that need to canonicalize
repeatedly pay the cost of loading the design system each time.

With `--stream`, a tool can start `tailwindcss canonicalize --stream`
once and send candidate groups over stdin as needed:

```sh
$ echo -e "py-3 p-1 px-3\nmt-2 mr-2 mb-2 ml-2" | tailwindcss canonicalize --stream
p-3
m-2
```

Related discussion:
https://github.com/tailwindlabs/tailwindcss/discussions/19736

---------

Co-authored-by: Robin Malfait <malfait.robin@gmail.com>
2026-03-16 15:00:11 +00:00
..
@tailwindcss-browser 4.2.1 (#19714) 2026-02-23 11:45:12 +01:00
@tailwindcss-cli Add --stream flag to canonicalize subcommand (#19796) 2026-03-16 15:00:11 +00:00
@tailwindcss-node Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
@tailwindcss-postcss Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
@tailwindcss-standalone 4.2.1 (#19714) 2026-02-23 11:45:12 +01:00
@tailwindcss-upgrade fix: remove unused braces dependencies (#19797) 2026-03-15 21:10:54 +00:00
@tailwindcss-vite Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
@tailwindcss-webpack 4.2.1 (#19714) 2026-02-23 11:45:12 +01:00
internal-example-plugin Prefix internal modules with internal-* (#14074) 2024-07-29 10:58:07 -04:00
tailwindcss Cleanup inconsistencies related to (regex) escapes (#19804) 2026-03-15 22:04:58 +01:00
tsconfig.base.json Improve debug logs (#15303) 2024-12-11 15:27:20 +01:00