Typed classnames for autocompletion
See original GitHub issueI like this API the most from the available Tailwind / RN projects but it’s a bit sad to lose the ability for auto-completion.
What about going from this:
tailwind('bg-blue-200 px-3 py-1 rounded-full')
to something like this:
tailwind('bg-blue-200', 'px-3', 'py-1', 'rounded-full')
Issue Analytics
- State:
- Created 3 years ago
- Reactions:12
- Comments:20 (2 by maintainers)
Top Results From Across the Web
VSCode - Autocomplete/Suggest user-typed CSS class names?
Does anyone know if there is a way to have VSCode autocomplete/suggest CSS class names that the user has typed in the document?...
Read more >How to Autocomplete CSS class names that include a minus ...
Inside my HTML files I want to autocomplete these class names. But when I type <span class="mAIcon mA|">. and I want to autocomplete...
Read more >Code Completion for classnames and clsx libraries in React ...
Spend less time typing or explore the possibilities for various CSS class names in React aps.
Read more >Find & Auto-Complete Class Names Quickly in Code - YouTube
Working with CSS can be time consuming and slow process specially when project gets bigger. When you add more and more classes to...
Read more >Typeahead class names (auto-completion) - Squiz Help Center
... that wraps highlighted text. Defaults to tt-highlight . Source: https://github.com/twitter/typeahead.js/blob/master/doc/jquery_typeahead.md#class-names ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For those who want a quick copy and paste:
^ add to your VS Code
settings.json
file. I’ve adjusted the regex to pick up single or double quotes.@matepapp nice find!
However, I can’t think of a sensible TypeScript solution that would not require the API change I mentioned above. Your current implementation would only allow one className in the
tailwind
function unless you generate all combinations of className strings.My proposal would look something like this: