Skip to content
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

Tailwind intellisense stops working based on size of cva object #77

Closed
LucasWinkler opened this issue Dec 6, 2022 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@LucasWinkler
Copy link

Describe the bug
Not entirely sure if it's an issue with CVA, the regex or the extension for tailwind intellisense. Also this is my first issue so I'm sorry if I should be creating this elsewhere.

I noticed when my compoundVariants had more than 7 objects inside the array the intellisense for tailwind completely stopped working. I created a new basic CVA button and noticed its not just compoundVariants it seems to depend on how long the strings are? If I duplicate intents, compoundVariants or any other object that has tailwind classes eventually the intellisense will no longer work. Also somethings the intellisense will work for some lines but not others. It all depends on how big component is. I feel like it's the regex but I'm not too sure.

To Reproduce
Steps to reproduce the behavior:

  1. Create a basic CVA button
const button = cva(
  '',
  {
    variants: {
      intent: {
        primary: 'bg-green-600 hover:bg-green-700 text-white',
      },
      modifier: {
        something: 'rounded',
      },
    },
    compoundVariants: [
      {
        modifier: 'something',
        variant: 'primary',
        className: 'text-green-500 hover:bg-transparent hover:text-green-600',
      },
    ],
  }
);
  1. Add/duplicate more intents or any other object that contains a few tailwind classes
  2. Hover over tailwind class
  3. See that there is no intellisense

Expected behavior
Intellisense should still show no matter how large the component is.

Screenshots
How it should be:
image

After duplicating a few times:
image

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser N/A
  • Version tailwind@3.2.4, cva@0.3.0
@LucasWinkler LucasWinkler added the bug Something isn't working label Dec 6, 2022
@joe-bell
Copy link
Owner

joe-bell commented Dec 6, 2022

I think we can probably expand #72 to include this

@joe-bell joe-bell closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2022
Repository owner locked and limited conversation to collaborators Dec 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants