- Run the following:
hugo new site $siteName cd $siteName hugo new theme $siteNameTheme git init cd themes/$siteNameTheme pnpm init pnpm install tailwindcss
- Connect
tailwind.config.js
to content & layouts:// tailwind.config.js /** @type {import('tailwindcss').Config} */ module.exports = { content: ["content/**/*.md", "layouts/**/*.html"], theme: { extend: {}, }, plugins: [], };
- Navigate to
/themes/sitethemeName/assets/css
. - Add a
src/input.css
with the following:@tailwind base; @tailwind components; @tailwind utilities;
- Update package.json with the following scripts:
"build-tw": "pnpm tailwindcss -i ./assets/css/src/input.css -o ./assets/css/main.css", "watch-tw": "pnpm tailwindcss -i ./assets/css/src/input.css -o ./assets/css/main.css -w --minify"
- Run
pnpm run watch-tw
from siteThemeName directory to enable watching for design changes.
You are ready to start creating and editing your theme.