1

I have a JSF project I want to use tailwind into it Could anyone has idea how implement tailwind CSS into JSF

https://tailwindcss.com/docs/installation

https://tailwindcss.com/docs/installation/using-postcss

I have tried to implement but I couldn't

1 Answers1

1

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:

  1. Run npm init in the webapp folder (where the xhtml files reside)
  2. Install tailwindcss as a dev dependency using npm
  3. Follow the tailwind getting started guide for tailwind css
  4. Finally, create a npm script for running tailwind css generation "css-watch": "tailwindcss -i ./main.css -o ./dist/styles.css --watch"
  5. 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.