Tailwind: prevent autcomplete classes found in css file
I am using Tailwind in my .NET project and I use the offical Tailwind CSS plugin. This grants me autocompletions of all Tailwind classes based on my config. This is perfect. Except, the autocomplete list is polluted with css classes found in the css file, which is also built by vite/Tailwind. This ends up with double suggestions (one from the plugin, one from the css file). I added screenshots to visualise my point. Is there a way to disable the normal css autocomplete so I only retain the useful Tailwind ones?
Please sign in to leave a comment.
From what I gather, you want to exclude classes from certain files from the list of suggestions. In general, Tailwind classes should be displayed above custom classes. We fixed this issue in the context of the following thread: https://youtrack.jetbrains.com/issue/WEB-57951/Tailwind-add-an-option-to-only-show-Tailwind-classes-in-completion-or-show-them-on-the-top-of-the-list. In your case, custom classes can be displayed above Tailwind classes because they have similar names. You can vote for the following feature request, where we discussed the possibility of excluding certain files from the completions list: https://youtrack.jetbrains.com/issue/WEB-55663/Ability-to-exclude-specific-CSS-files-and-folders-from-CSS-class-code-completion.
At present, you can exclude required CSS files from indexing so they do not appear in the list of suggestions: https://www.jetbrains.com/help/webstorm/indexing.html#exclude.