HTML-CSS-Class-Completion icon indicating copy to clipboard operation
HTML-CSS-Class-Completion copied to clipboard

Automatic TailwindCSS Detection & Opt-out

Open noor-codes opened this issue 3 years ago • 3 comments

Automatic TailwindCSS Detection & Opt-out

TailwindCSS Generates thousands of classes, sometimes it goes over 200k. It should automatically opt-out of indexing them for performance reasons.

@TailwindCSS already has a built-in extension for it.

I love this extension but I just don't prefer it when I am working with Tailwind.

This update will help a lot cause I manually disable it for each and every workspace.

Thanks!

noor-codes avatar Mar 09 '21 09:03 noor-codes

Have you considered the html-css-class-completion.excludeGlobPattern user setting to skip Tailwind files?

It is described here in the README.md: https://github.com/zignd/HTML-CSS-Class-Completion#folders-and-files

zignd avatar Mar 09 '21 10:03 zignd

I have no idea where the tailwind files are. I use NextJs and all the files live in .next folder.

Considering advanced built-in features like code splitting and dynamically injecting things when the components mount in run-time, It would be pretty hard to use html-css-class-completion.excludeGlobPattern solution.

Common Issues

  • I can setup the GlobalExclude Pattern in this case but that varies from project to project
  • Some projects inject CSS dynamically into the DOM using JavaScript so we can't trace that.
  • It eventually becomes a setup hell.

noor-codes avatar Mar 10 '21 07:03 noor-codes

I suggest, at least if there is a way for the extension to look for tailwind.config.js file at the top level root file tree and if there is one, just skip indexing stuff in the project would be really helpful.

noor-codes avatar Mar 10 '21 07:03 noor-codes