templ
templ copied to clipboard
Tailwind CSS Intellisense Support Missing Critical Information in the docs
I have just spent forever trying to get Tailwind CSS Intellisense to work in .templ files
I know it may sound obvious in hindsight. In the end, turns out that I was missing the tailwind config file (tailwind.config.{js,cjs,mjs,ts}) in my project.
Please add a little note to the docs about having a tailwind config file.
@Jatin-MYST I think this is what were asking for https://github.com/a-h/templ/blob/d61470219c74a0bfc3a2a7f18f937fd943b68c30/docs/docs/09-commands-and-tools/02-ide-support.md?plain=1#L98
https://templ.guide/commands-and-tools/ide-support#tailwind-css-intellisense
@Khalid-Nowaf Not quite.
I did read the docs and did exactly what it told me. The issue is that the docs doesn't mention to have a tailwind.config.js file in your project. So, it didn't work for me.
After spending a long time I found out that I was missing the config file. It worked right away after adding that file.
Having the info about the required config file in the docs will help any future devs not waste their time.
@Jatin-MYST I think this is what were asking for
https://github.com/a-h/templ/blob/d61470219c74a0bfc3a2a7f18f937fd943b68c30/docs/docs/09-commands-and-tools/02-ide-support.md?plain=1#L98
https://templ.guide/commands-and-tools/ide-support#tailwind-css-intellisense I have a similar problem with the autocomplete for tailwind I did what the documentation said but it didn't seem to work am I missing something?
![]()
The issue is 3 here. Tailwind's lsp looks for a file listed here. If it doesn't find one it doesn't know where to start.
It's not a templ specific issue but a note about this could be helpful to making sure it's easy to get going with templ. I can get around to writing it at some point.
There is a note in the docs now for the tailwind config #367
Just needs a docs PR to add an extra paragraph or note block to remind people to add the tailwind.config.js file. Happy to take a PR for it.