classname-variants 1.3.2 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/lib/react.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -187,7 +187,7 @@ const Button = styled("button", {
|
|
|
187
187
|
});
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
>
|
|
190
|
+
> [!TIP]
|
|
191
191
|
> You can also style other custom React components as long as they accept a `className` prop.
|
|
192
192
|
|
|
193
193
|
## Styled components without variants
|
|
@@ -254,10 +254,10 @@ You can then add the following line to your `settings.json`:
|
|
|
254
254
|
"tailwindCSS.experimental.classRegex": ["tw`(.+?)`"]
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
>
|
|
258
|
-
> The `tw` helper function is just an alias for [`String.raw`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw).
|
|
257
|
+
> [!NOTE]
|
|
258
|
+
> The `tw` helper function is just an alias for [`String.raw()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/raw) which has the nice side effect backslashes are not treated as [escape character in JSX](https://tailwindcss.com/docs/adding-custom-styles#handling-whitespace).
|
|
259
259
|
|
|
260
|
-
In order to get type coverage even for your Tailwind classes you can use a tool like [tailwind-ts](https://github.com/mathieutu/tailwind-ts).
|
|
260
|
+
In order to get type coverage even for your Tailwind classes, you can use a tool like [tailwind-ts](https://github.com/mathieutu/tailwind-ts).
|
|
261
261
|
|
|
262
262
|
# License
|
|
263
263
|
|
package/lib/react.js
CHANGED
|
@@ -11,7 +11,7 @@ export function variantProps(config) {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
// Add the optionally passed className prop for chaining
|
|
14
|
-
result.className = [props
|
|
14
|
+
result.className = [variantClassName(props), props.className]
|
|
15
15
|
.filter(Boolean)
|
|
16
16
|
.join(" ");
|
|
17
17
|
return result;
|