1.0.4 • Published 5 years ago

@macklinu/cx v1.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

cx

A utility for creating className strings

Installation

yarn add @macklinu/cx

Usage

This is a simplified version of classnames, where any truthy string argument to the cx() function will be turned into a class string.

import cx from '@macklinu/cx'

cx('foo', 'bar') // 'foo bar'

// say state === 'loading'
cx('bg-red', 'text-white', state === 'loading' && 'is-loading') // 'bg-red text-white is-loading'

cx() // ''