dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

Error opening autocomplete window in tailwind css

Open RustGrow opened this issue 1 year ago • 3 comments

When there is no space between the class and the parameter string, the parameter autocomplete window in tailwind css does not work

https://github.com/user-attachments/assets/490ec03c-8bbe-4950-803b-e8abe76bfb14

Environment:

Dioxus version: 0.6.0-alpha.2 (https://github.com/DioxusLabs/dioxus/commit/b25469208f999dd44e7884c42f525d48dca05a32) from github 19/09/24 Rust version: rustc 1.81.0 (eeb90cda1 2024-09-04) OS info: Win11 App platform: web

RustGrow avatar Sep 23 '24 22:09 RustGrow

That sounds like an issue with your tailwind.css config. You can change your class regex to "tailwindCSS.experimental.classRegex": ["class: ?\"(.*)\""] to make the space optional

ealmloff avatar Sep 24 '24 01:09 ealmloff

Does dx format add the spacing? If yes, then the problem is less prominent.

chungwong avatar Sep 25 '24 04:09 chungwong

My new settings

"tailwindCSS.classAttributes": [
    "class",
    "className",
    "ngClass",
    "class:"
  ],
  "tailwindCSS.experimental.classRegex": [
    "class\\s*:\\s*\"([^\"]*)"
  ],
  "tailwindCSS.includeLanguages": {
    "rust": "html"
  },
  "tailwindCSS.experimental.configFile": null,

But if you don't save when you type the code, the autocomplete won't work. So this is not a solution to the problem. The only thing left to do is to train yourself to always put a space between a colon and double quotes

RustGrow avatar Oct 03 '24 11:10 RustGrow