- Make sure you have these npm dependencies installed
- Hugo v0.92.0 (May work with older versions too, but not tested)
- tailwindcss
- postcss
- postcss-cli
- autoprefixer
- Run
npx tailwindcss init -p
to create a TailwindCSS and a PostCSS config file. - Add this to your tailwind.config.js file:
{
content: ['./layouts/**/*.html', './content/**/*.md']
}
- Run
hugo
orhugo server -D --watch
to see the result
Read the full article here: https://dev.to/jonas_duri/how-to-use-tailwindcss-30-without-external-npm-scripts-just-hugo-pipes-2lg9
This already includes the proposed changes from @nnooney: gohugoio/hugo#8343 (comment)