I've tried using tailwind with postcss, and didn't get it to work. It was a lot of issues with getting the postcss processor to run. Using the tailwind cli went like a charm, however. The step are as follows:
- Run npm init in the webapp folder (where the xhtml files reside)
- Install tailwindcss as a dev dependency using npm
- Follow the tailwind getting started guide for tailwind css
- Finally, create a npm script for running tailwind css generation
"css-watch": "tailwindcss -i ./main.css -o ./dist/styles.css --watch"
- Start the css-watch script using
npm run css-watch
Then, you probably want to do some hiding of the irrelevant files when you package the app. This is not necessary, but might be a requirement security-wise.