Closed nwpappas closed 3 months ago
You should change your class regex to handle all the quotes like this:
{
"tailwindCSS.experimental.classRegex": [
["clsx\\(([^)]*)\\)", "'([^']*)'"],
["clsx\\(([^)]*)\\)", "\"([^\"]*)\""],
["clsx\\(([^)]*)\\)", "`([^`]*)`"],
]
}
Note that I've included the specific quote type in the inner, negated character class. Because we have a constraint of a single capture group it's easiest to split it up into three regexes.
With this change you should see colors in all spots:
What version of VS Code are you using?
1.85.2
What version of Tailwind CSS IntelliSense are you using?
For example: v0.10.5
What version of Tailwind CSS are you using?
For example: v3.4.1
What package manager are you using?
For example: npm
What operating system are you using?
For example: macOS
Tailwind config
VS Code settings
Describe your issue
When adding classes to
clsx()
the color decorator appears when using single quotes, but not when using double quotes. This is troublesome when using Prettier's default quote rules.