Tailwind

See Serving Static Files

Add this to your build script.

pnpm tailwindcss -o src/static/styles.css --minify
//tailwind.config.js
/** @type {import('tailwindcss').Config} */
module.exports = {
  content: ["./src/**/*.templ"],
  theme: {
    extend: {},
  },
  plugins: [],
}

Vscode Settings

The following will makes templ files get treated as HTML files as far as tailwind/emmet is concerned. This should make templ files have all the conveniences you’d expect and that you’re probably used to when writing JSX.

"tailwindCSS.includeLanguages": {/*...*/"templ": "html"},
"emmet.includeLanguages": {"templ": "html"},