clsx
clsx copied to clipboard
A tiny (239B) utility for constructing `className` strings conditionally.
Hi friends, I did some minor changes to increase performance. the benchmark result is: ``` # Strings classcat* x 6,206,358 ops/sec ±1.24% (90 runs sampled) classnames x 3,408,198 ops/sec ±0.88%...
```diff export default function () { - var i=0, tmp, x, str=''; + var tmp, x, len=arguments.length, str='', i=0; - while (i < arguments.length) { + while (i < len)...
Hi, I think this small change improves the performance slightly ;) ``` # Strings classcat* x 6,665,229 ops/sec ±0.73% (91 runs sampled) classnames x 3,445,132 ops/sec ±1.66% (93 runs sampled)...
Size before: ``` Filename Filesize (gzip) dist\clsx.js 358 B 230 B dist\clsx.m.js 357 B 228 B dist\clsx.min.js 517 B 290 B ``` Size after: ``` Filename Filesize (gzip) dist\clsx.js 357...
`clsx` just [overtook](https://npmtrends.com/classnames-vs-clsx) `classnames`, the package `clsx` was designed be a drop-in replacement for.  To celebrate and as a token of appreciation (I'm using your package virtually everywhere) I'm...
This PR changes the regular expression for VS Code IntelliSense to ignore lines beginning with `//`
Hi there! I've added the guide on how to enable autocomplete for the JetBrains IDEs such as Webstorm. It might be helpful for the users of the JetBrains ecosystem. I...
Hi there, I'm using a css-in-js library ([stitches](https://github.com/stitchesjs/stitches)) which returns class names as objects with custom `toString` methods. This requires calling `toString` before passing the "class names" to `clsx`- otherwise...
I'm an active user of `clsx` and a big fan of its speed and size advantages over classnames. I've noticed that `clsx`'s usage trend is gaining more popularity, which is...
I am trying to upgrade from 1.2.1 to 2.1.0, however the module resolution can't seem to be finding clsx. I am running Node version 18 and moduleResolution is set to...