ReScript PPX validates the tailwindcss class names
npm install @greenlabs/res-tailwindcssA ReScript PPX, which validates the tailwindcss class names
The tailwind-ppx is the only ppx to validate the tailwindcss class names in compile time. But, it was archived, and written by ocaml-migrate-parsetree. My team considered taking over the repository and maintaining it but decided to rewrite it from the scratch with ppxlib and menhir. Additionally, we improve the logic to find the invalid class name with Spelling Corrector algorithm.
Plus, the arbitrary values in the JIT mode of Tailwindcss are supported!
``html` ... ... ... ... ... ... ... ... svg]:rotate-180")> ...
``
yarn add -D @greenlabs/res-tailwindcss
should be replaced with the relative location of your generated tailwindcss file from your project root in which the bsconfig.json file is located.
`
// bsconfig.json
"ppx-flags": [
...,
["@greenlabs/res-tailwindcss/ppx", "--path
],
`
`rescript`svg]:rotate-180")>
...
1. Create a sandbox with opam
``
opam switch create tailwindcss 4.14.0
2. Install dependencies
``
opam install . --deps-only --with-test
3. Build
``
opam exec -- dune build
4. Test
`
cd rescript
(install dependencies)
yarn
(build --watch)
yarn res:clean && yarn res:watch
(run test --watch)
yarn test:watch
``