lukeed/clsxPublic

A tiny (239B) utility for constructing `className` strings conditionally.

docs: Tweak Tailwind CSS Intellisense regex to handle inner brackets #106

Closedlongzhengclosed 1 commit intomasterfromrefs/pull/106/head
  1. LO

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

    ```ts 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

  2. longzhengreferenced this in CLSX mulitline #39last year on GitHub

  3. longzhengreferenced this in docs: Update intellisense regex to handle inner brackets #332last year on GitHub

  4. longzhengrenamed Tweak Tailwind CSS Intellisense regex to handle inner brackets to docs: Tweak Tailwind CSS Intellisense regex to handle inner bracketslast year on GitHub

  5. longzhenghead-ref-force-pushed 2f5a2b1abc9blast year on GitHub

  6. JD

    Tailwind intellisense actually now supports a classFunctions setting, to which you can just add "clsx" without messing with regex.

  7. longzhengclosedlast year on GitHub

  8. longzhengreferenced this in Autocomplete randomly stops working after certain line #1430last year on GitHub

  9. LO
    Author

    Just wanted to leave a reference in case anyone else comes across this issue, [there seems to be some complex issue](https://github.com/tailwindlabs/tailwindcss-intellisense/issues/1430#issuecomment-3349728671) with the Tailwind CSS IntelliSense extension when using `classFunctions` that breaks autocomplete after a certain line, whereas `classRegex` will still work.