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 !
# Using npm
npm install --save clsf
# Using yarn
npm add --save clsf
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'
import cls from 'clsf';
// or
import { cls } from 'clsf';
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.
- Author Yoni Calsin
- Twitter Yoni Calsin
Thanks to the wonderful people who collaborate with me !
clsf
under License MIT.