clsf
v1.0.1
Published
A function that merges given class names, no matter their format. Filters out invalid class names as well.
Downloads
8
Maintainers
Readme
clsf, classnames
A function that merges the given class names, regardless of their format. It also filters out invalid class names, and is compatible with several frameworks such as react, angular, vue, ember, and many more !
Installation
# Using npm
npm install --save clsf
# Using yarn
npm add --save clsf
🌎 Usage
const clsf = require('clsf');
clsf('a', 'b', 'c');
//=> 'a b c'
clsf('a b', 'c d', 'e f');
//=> 'a b c d e f'
clsf(['a', 'b'], ['c', 'd']);
//=> 'a b c d'
clsf(['a b', 'c d'], ['e f', 'g h']);
//=> 'a b c d e f g h'
clsf('a', 'b', ifAlready && 'c');
//=> 'a b'
clsf('a', 'b', 'c', null, ['d', null], () => {}, 'e', undefined);
//=> 'a b c d e'
🎁 Using Typescript
import cls from 'clsf';
// or
import { cls } from 'clsf';
⭐ Support for
clsf
is an open source project licensed by MIT. You can grow thanks to the sponsors and the support of the amazing sponsors. If you want to join them, contact me here.
🎩 Stay in touch
- Author Yoni Calsin
- Twitter Yoni Calsin
🚀 Contributors
Thanks to the wonderful people who collaborate with me !
📜 License
clsf
under License MIT.