classname-manipulator
A simple javascript utility for building classNames. It's like classnames utility, however it allows you to use bem-naming notation and css-modules.
Usage
This utility was designed to be used with React components and helps you to build classNames for the components in an easier way. It uses certain properties: className
, childName
, theme
.
Plain example:
'use strict'; var cm = ; var props = className: 'button' theme: action: true; ; // 'button button--action'
Using react and css-modules:
'use strict'; import cm from 'classname-manipulator';import styles from './Button.css'; { var classes = ; return <Button => thispropschildren </Button> ; }