1.1.1 • Published 3 years ago

@jikanban/cls v1.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

cls

A simple utility for conditionally joining className strings. Also serves as a smaller drop-in replacement for the classnames package.

Install

# With NPM
$ npm install --save @jikanban/cls

# With Yarn
$ yarn add @jikanban/cls

Usage

import cls from '@jikanban/cls'

cls('foo', 'bar')
// => 'foo bar'

cls('foo', { bar: true })
// => 'foo bar'

cls({ 'foo-bar': true })
// => 'foo-bar'

cls({ 'foo-bar': false })
// => ''

cls({ foo: true }, { bar: true })
// => 'foo bar'

cls({ foo: true, bar: true })
// => 'foo bar'

cls('foo', { bar: true, duck: false }, 'baz', { quux: true })
// => 'foo bar baz quux'

cls(null, false, 'bar', undefined, 0, 1, { baz: null }, '')
// => 'bar 1'
1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.10

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.2

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago