lambda-fairy / maud

:pencil: Compile-time HTML templates for Rust
https://maud.lambda.xyz
Apache License 2.0
2.15k stars 143 forks source link

not an issue, just a tip for working with tailwind + maud #399

Open vidhanio opened 1 year ago

vidhanio commented 1 year ago

i apologize for creating an issue if it is inappropriate, but i couldn't find a better place to put this tip. if you are working with tailwind + maud and are using the tailwind vscode extension, you can set the following configuration options in your settings.json to get the tailwind autocompletion and hover docs in your maud code:

{
  "tailwindCSS.includeLanguages": {
    "rust": "html"
  },
  "tailwindCSS.experimental.classRegex": [
    ["\\w+((?:\\.\\s*\\S+\\s*)*)", "\\.\"?([^.\"]+)\"?"]
  ]
}
preview screenshot

thank you for the wonderful library! :)

SenojLuap commented 12 months ago

I didn't get this to work. Are there any other settings you changed?

vidhanio commented 12 months ago

I didn't get this to work. Are there any other settings you changed?

ah yes, i forgot to mention this, i just realized.

{
  "tailwindCSS.includeLanguages": {
    "rust": "html"
  }
}
hadamove commented 11 months ago

This was extremely helpful. Perhaps it would make sense to include this in official docs?

Wragdan commented 5 months ago

For neovim users if using lspconfig:

require('lspconfig').tailwindcss.setup({ filetypes = { ..., 'rust' }, init_options = { userLanguages = { ..., rust = "html" } }, })