Skip to content

Custom components + intellisense #1247

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

Open
Kcko opened this issue Mar 4, 2025 · 2 comments
Open

Custom components + intellisense #1247

Kcko opened this issue Mar 4, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Kcko
Copy link

Kcko commented Mar 4, 2025

Hi,

Similar issue but unfinished: #1188

I'm looking for a way to make it so that intellisense will also show custom components (custom classes).

In version 3 it could be done like this: https://dev.to/glocore/tip-add-typography-as-components-to-your-tailwind-config-4l4c

But it's an awkward way, not convenient to write just for the sake of hinting components and classes in a .js file.

Is it possible to modify intellisense to hint everything under @layer utilities/components?

In the topic above it says @layer utility sees it, but that's not the right place under components after all.

Please respond, is this the only thing bothering me about this great plugin since the first time I used it.

@thecrypticace thecrypticace added the enhancement New feature or request label Mar 5, 2025
@thecrypticace
Copy link
Contributor

Things work this way because CSS placed inside @layer utilities, @layer components, or @layer whatver-name-it-is are not actual "utilities" known to Tailwind CSS v4. Meaning they don't get support for variants, modifiers, being marked as important, prefixing, etc… To do that you must use @utility. (and v3 never supported reading utilities from CSS files in IntelliSense anyway)

I prototyped arbitrary class suggestions last week to see what it'd take and it is possible but it's not performant at all. Adding several milliseconds to the generating completions for even a project with one small CSS file. There's also a number of edge cases that need to be handled like not showing these suggestions when a variant has been typed. Ultimately, I'll need to add some APIs to Tailwind CSS itself before we can add this feature but it is planned.

@Kcko
Copy link
Author

Kcko commented Mar 6, 2025

it is planned.

Great!

I'm not going to bother with this anymore, but where can I read about this? I want to know in the first wave, I'll keep checking, it's really important to me (I'm sure it is to others).

Thanks for the info and good luck with the development :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants