templ icon indicating copy to clipboard operation
templ copied to clipboard

Tailwind CSS Intellisense Support Missing Critical Information in the docs

Open Jatin-MYST opened this issue 1 year ago • 4 comments

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 avatar Dec 20 '23 00:12 Jatin-MYST

@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 avatar Dec 20 '23 09:12 Khalid-Nowaf

@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 avatar Dec 21 '23 00:12 Jatin-MYST

@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? Jepretan Layar 2023-12-23 pukul 18 21 26 Jepretan Layar 2023-12-23 pukul 18 21 37

vadhe avatar Dec 23 '23 10:12 vadhe

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.

JonnyLoughlin avatar Dec 24 '23 02:12 JonnyLoughlin

There is a note in the docs now for the tailwind config #367

nathan-hello avatar Jan 25 '24 18:01 nathan-hello

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.

a-h avatar Jan 26 '24 08:01 a-h