twc
twc copied to clipboard
[Help] tailwindCSS.experimental.classRegex for Adapting based on props
💬 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\\([^`]*?\\).*?\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]