From 225789e9f4c467ab215eef20186dc9f67e0e4a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Wed, 18 Jan 2023 16:29:40 -0600 Subject: [PATCH 1/3] Add usage with Tailwind documentation Add documentation on how to enable Tailwind IntelliSense inside `clsx` functions Fixes #64 --- readme.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/readme.md b/readme.md index cba8d87..f95fc11 100644 --- a/readme.md +++ b/readme.md @@ -83,6 +83,28 @@ All browsers that support [`Array.isArray`](https://developer.mozilla.org/en-US/ - [obj-str](https://github.com/lukeed/obj-str) - A smaller (96B) and similiar utility that only works with Objects. +## Tailwind CSS +Here some additional (optional) steps to enable classes autocompletition using `clsx` with Tailwind CSS. +
+ + + Visual Studio Code + + +1. [Install the "Tailwind CSS IntelliSense" Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss) + +2. Add the following to your [`settings.json`](https://code.visualstudio.com/docs/getstarted/settings): + + ```json + { + "tailwindCSS.experimental.classRegex": [ + ["clsx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"] + ] + } + ``` +
+ + ## License MIT © [Luke Edwards](https://lukeed.com) From e2a1d09d476dad89f46067404eab1e3005872feb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Wed, 18 Jan 2023 16:51:06 -0600 Subject: [PATCH 2/3] Update readme.md Co-authored-by: Luke Edwards --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index f95fc11..0026517 100644 --- a/readme.md +++ b/readme.md @@ -83,7 +83,8 @@ All browsers that support [`Array.isArray`](https://developer.mozilla.org/en-US/ - [obj-str](https://github.com/lukeed/obj-str) - A smaller (96B) and similiar utility that only works with Objects. -## Tailwind CSS +## Tailwind Support + Here some additional (optional) steps to enable classes autocompletition using `clsx` with Tailwind CSS.
From ce8c0063d061694f5f3584452f00888cc1179cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edgar=20L=C3=B3pez?= Date: Wed, 18 Jan 2023 16:52:13 -0600 Subject: [PATCH 3/3] Update readme.md --- readme.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 0026517..d3839be 100644 --- a/readme.md +++ b/readme.md @@ -78,11 +78,6 @@ All browsers that support [`Array.isArray`](https://developer.mozilla.org/en-US/ >**Note:** For IE8 support and older, please install `clsx@1.0.x` and beware of [#17](https://github.com/lukeed/clsx/issues/17). - -## Related - -- [obj-str](https://github.com/lukeed/obj-str) - A smaller (96B) and similiar utility that only works with Objects. - ## Tailwind Support Here some additional (optional) steps to enable classes autocompletition using `clsx` with Tailwind CSS. @@ -105,6 +100,9 @@ Here some additional (optional) steps to enable classes autocompletition using ` ```
+## Related + +- [obj-str](https://github.com/lukeed/obj-str) - A smaller (96B) and similiar utility that only works with Objects. ## License