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

[Help] tailwindCSS.experimental.classRegex for Adapting based on props #47

Open
p-iknow opened this issue Jun 10, 2024 · 1 comment
Open

Comments

@p-iknow
Copy link

p-iknow commented Jun 10, 2024

💬 Is there a way to get support from Tailwind CSS IntelliSense even when using patterns like the one below?

import { twc, TwcComponentProps } from "react-twc";
 
type ButtonProps = TwcComponentProps<"button"> & { $primary?: boolean };
 
const Button = twc.button<ButtonProps>((props) => [
  "font-semibold border border-blue-500 rounded",
  props.$primary ? "bg-blue-500 text-white" : "bg-white text-gray-800",
]);

I followed the instructions in the getting started guide and made the configurations, but IntelliSense did not work for patterns like the code above.

"tailwindCSS.experimental.classRegex": [
    "twc\\.[^`]+`([^`]*)`", 
    "twc\\([^`]*?\\)`([^`]*)`",
    ["twc\\.[^`]+\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
    ["twc\\([^`]*?\\).*?\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
@p-iknow p-iknow changed the title tailwindCSS.experimental.classRegex for Adapting based on props [Help] tailwindCSS.experimental.classRegex for Adapting based on props Jun 10, 2024
@gregberge
Copy link
Owner

Hello @p-iknow, thanks for raising that! Any help is welcome for that! If a regexp god passes by 🙏

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

No branches or pull requests

2 participants