1.0.1 • Published 4 years ago

clsf v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

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

🚀 Contributors

Thanks to the wonderful people who collaborate with me !

📜 License

clsf under License MIT.