clsx icon indicating copy to clipboard operation
clsx copied to clipboard

docs: Tweak Tailwind CSS Intellisense regex to handle inner brackets

Open longzheng opened this issue 9 months ago • 0 comments

The current Tailwind CSS Intellisense regex doesn't handle inner brackets, for example if I have a value of

clsx([`bg-background focus:shadow-[0_0_15px_0_rgba(0,0,0,0.1)] text-foreground`]);

Then the current regex will stop matching after the rgba(0,0,0,0.1) because of the end bracket. Demo https://regex101.com/r/B35VfZ/1

This updated regex handles inner brackets. Demo https://regex101.com/r/WocUfB/1

longzheng avatar Jan 22 '25 06:01 longzheng