Since TailWind 3.0 has its own watch mode, and so does Hugo I wasn't able to link them together. This means you won't be able to see changes made to the CSS live as they happen.
For production use, however, the procedure is simple:
npm install
to install dev dependencies listed in package.json
npx tailwindcss -i ./static/input.css -o ./static/main.css
hugo
to build the website, or hugo server
to run a live server on
localhost:1313layouts
directory and the
content
directory has the markdown formatted content (like pages, blog posts,
etc).npx tailwindcss -i ./static/input.css -o ./static/main.css
command takes all the base, utilities and other components of tailwind from static/input.css
, scans all the content
and layouts
directory for styles that are actually being used and spits out static/main.css
which is tiny, minimal and production readystatic/main.css
is the final CSS that is included in layouts/partial/head.html
which adds it to the HTML tag of all the generated pages