Repository navigation
NormWind: a CLI and GitHub Action that rewrites long-hand Tailwind v4 classes using Tailwind's own canonicalizer #20712
LunarWerxs
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I made this.
NormWind is a CLI and GitHub Action that rewrites long-hand Tailwind v4 classes into their shorter canonical form. It uses Tailwind's own canonicalizer and only applies a merge when the compiled CSS does not change. Examples from the README:
px-4 py-4becomesp-4w-6 h-6becomessize-6rounded-[24px]becomesrounded-3xlRun it in a project that uses Tailwind v4:
Run
--fixon a clean git tree and review the diff. The GitHub Action adds inline PR annotations and can write SARIF for code scanning. It covers Vue, Svelte, Astro, HTML, JS and TS files.NormWind does not sort classes or run a formatter, so it runs alongside prettier-plugin-tailwindcss.
The ESLint plugin in #20596 focuses on non-canonical values such as
w-[16px]and runs inside ESLint. NormWind is a standalone CLI and CI action. It also merges shorthand pairs likepx-4 py-4, and it does not need ESLint.NormWind is MIT licensed: https://github.com/LunarWerxs/NormWind
If it rewrites something wrong, please reply with the class string and the output you expected.
All reactions