leroy
v0.0.2-1
Published
Css modules' monster for React className
Downloads
5
Maintainers
Readme
Leroy
Css module monster for React className
Install
npm install --save leroy
Getting Started
import { leroy } from 'leroy'
import styles from './index.css'
class App extends React.Component {
render() {
return (
<div
className={leroy(styles).add('a', true)
.add('b', false)
.add('c', true).put()}
/>
)
}
}
Usage
const styles = {
a: "a1",
b: "b2",
c: "c3"
}
leroy(styles).add('a', true)
.add('b', false)
.add('c', true)
.put();
// => 'a1 c3'
leroy(styles).bulk({
a: true,
b: false,
c: true
}).put()
// => 'a1 c3'
leroy(styles).cls('a b').put()
// => 'a1 b2'