Closed will-stone closed 11 months ago
@will-stone I encountered the same issue. I found this regex here
"tailwindCSS.experimental.classRegex": [
["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^\"'`]*)(?:'|\"|`)"]
]
Its only slightly different but it gets rid of the css conflict.
Hope this helps
Thanks @writeens Mine seems to be working fine without any regex now, but good to know I can use this if I have any issues 👍
Hi Luke 👋
Please excuse my lack of regex knowledge. The Tailwind set-up instruction currently flags items in nested ternaries as conflicting, even though the logic paths are unique. Here's an example where a different
size
prop results in different class strings resulting in different sized text:I'm guessing this is something that any amount of regex-fu isn't going to solve as it's runtime logic.
We chose to use nested ternaries because the string concat is much faster than array/object notation. It also means conditionals stop being checked as soon as the first passing condition is reached.
Would love to hear your thoughts 😄
Thanks,
Will.