| Name | Modified | Size | Downloads / Week |
|---|---|---|---|
| Parent folder | |||
| README.md | 2023-12-29 | 1.0 kB | |
| v2.1.0 source code.tar.gz | 2023-12-29 | 28.0 kB | |
| v2.1.0 source code.zip | 2023-12-29 | 31.9 kB | |
| Totals: 3 Items | 61.0 kB | 0 | |
Features
-
Add new
clsx/litesubmodule forstring-only usage: 1a49142This is a 140b version of
clsxthat is ideal for Tailwind and/or React contexts, which typically follow thisclsxusage pattern:js clsx('foo bar', props.maybe && 'conditional classes', props.className);Important: This
clsx/litemodule ignores all non-string arguments and is therefore not a 1:1 replacement forclsxitself!```js import { clsx } from 'clsx'; import { clsx as lite } from 'clsx/lite';
// strings-only usage is identical clsx('foo', null, 'bar', true && 'baz'); //=> "foo bar baz" lite('foo', null, 'bar', true && 'baz'); //=> "foo bar baz"
// clsx/lite ignores all non-strings clsx('foo', { a: true, b: false, c: true }); //=> "foo a c" lite('foo', { a: true, b: false, c: true }); //=> "foo" ```
Full Changelog: https://github.com/lukeed/clsx/compare/v2.0.1...v2.1.0