- ED
Add documentation on how to enable Tailwind IntelliSense inside `clsx` functions
Fixes #64
- LUHidden as resolved.
- LU
No review summary.
- LU
Thanks! Can you move this section between `Support` and `Related`?
- ED
@lukeed Done!
lukeedmentioned3 years ago on GitHub
lukeedsubscribed3 years ago on GitHub
- LU
Thanks :)
lukeedmerged 496db1dd74413 years ago on GitHub
- KAreadme.md:97ce8c006
👋 @lukeed! Thanks for adding this regex! Can you please elaborate on your approach to building it? I was using https://github.com/shadcn/ui/blob/5e172fc34fdf015aa0d141f52cc8c082b8ae6613/.vscode/settings.json#L7-L8 before seeing your solution. There is a slight difference, so I'm curious if there are any edge cases not covered by any of the two regexps:
```diff shadcn/ui - ["cn\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"] + ["cn\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] your regex ```
- KA
No review summary.
- LUreadme.md:97ce8c006
@edgarlr contributed this section so perhaps they can offer an explanation.
By eyeballing it, the difference is that `([^']*)` will match anything up to `'`, which means that if `"` or or backticks appear in the class value, then the regexp in _our_ docs will include it as part of the value, whereas the other regexp stops there.
clsx doc's regexp <img width="283" alt="Screen Shot 2023-07-18 at 10 43 53 AM" src="https://github.com/lukeed/clsx/assets/5855893/0a0f4e46-08bc-4d09-9552-dbd594c5b699">
shadcn/ui regexp <img width="264" alt="Screen Shot 2023-07-18 at 10 44 16 AM" src="https://github.com/lukeed/clsx/assets/5855893/415538d8-7435-42ed-b41d-0f1740d2238b">
Looks like they're both not ideal, tbh I don't use this extension, but perhaps something like this is better? I don't know if the extn is looking for the first matching group only, though
<img width="218" alt="Screen Shot 2023-07-18 at 10 53 57 AM" src="https://github.com/lukeed/clsx/assets/5855893/94adef8d-a66b-41da-98ef-e64b3ed0a8ef">
- LU
No review summary.
sync-by-unito[bot]referenced this in build(deps): bump clsx from 1.2.1 to 2.0.0 #3123 years ago on GitHub
rsazreferenced this in [Snyk] Upgrade clsx from 2.0.0 to 2.1.1 #512 years ago on GitHub
salgadevreferenced this in [Snyk] Upgrade clsx from 2.0.0 to 2.1.1 #172 years ago on GitHub
wierzareferenced this in [Snyk] Upgrade clsx from 2.0.0 to 2.1.1 #1472 years ago on GitHub