classix 2.1.13 → 2.1.15
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 +18 -0
- package/dist/cjs/classix.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -90,6 +90,24 @@ Sources: Ran [benchmark](benchmark/) on an AMD Ryzen 5 5600x.
|
|
|
90
90
|
- Fully tested
|
|
91
91
|
- [Semver](https://semver.org/) compliant
|
|
92
92
|
|
|
93
|
+
## Migrating to classix
|
|
94
|
+
|
|
95
|
+
If you are using `classnames` or `clsx`, you can migrate to `classix` by changing your `imports`:
|
|
96
|
+
|
|
97
|
+
```diff
|
|
98
|
+
- import classnames from 'classnames';
|
|
99
|
+
+ import cx from 'classix';
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
And if you were using object arguments, you'll have to convert them to string arguments:
|
|
103
|
+
|
|
104
|
+
```diff
|
|
105
|
+
- classnames({ 'class-1': cond });
|
|
106
|
+
+ cx(cond && 'class-1')
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
That's it!
|
|
110
|
+
|
|
93
111
|
## Changelog
|
|
94
112
|
|
|
95
113
|
For a list of changes and releases, see the [changelog](https://github.com/alexnault/classix/releases).
|
package/dist/cjs/classix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function e(){let e,t="",r=0;for(;r<arguments.length;)(e=arguments[r++])&&"string"==typeof e&&(t&&(t+=" "),t+=e);return t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.cx=e,exports.default=e;
|