-
Notifications
You must be signed in to change notification settings - Fork 214
Add intellisense when using classnames plugin #197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I have my own minimalist version of this ( No idea what the low level parsing looks like, but detecting the |
Hey @davea38! Any strings inside the class(Name) attribute should already trigger the completions: Is this not working for you? |
@bradlc that's great if you call |
Thanks for your reply @bradlc! As @kristiandupont points out, the majority of the time I am using classNames before a JSX return in a plain javascript function. It's less of a problem as I become more familiar with Tailwind, but my brain has a finite limit for the amount of 'stuff' it can hold... :) Apologies that my example didn't actually cover the USE case that I wanted! |
You sort of can 😝. However, as soon as you format JS adding spaces between `=` char, it'll stop intellisense and the color decorations will disappear.
This "works" because of this:
It'd be great if the RegExp allowed matching import { clsx as className } from './my-classNames-lib'
const styles = className({ white: 'text-white' }, 'bg-green-400') |
Please see tailwindlabs/tailwindcss#7553, in particular my recent comment |
@bradlc - thank you! Will try this feature out in the latest version :) |
I write a lot of react code and use the https://github.com/JedWatson/classnames plugin for conditional CSS rendering.
Any chance you could enable this plugin to detect the classNames function?
The text was updated successfully, but these errors were encountered: