Onner is a tiny package for attach css class by inline style to the document head.
Installation
$ npm i onner
Usage
import o from 'onner';
Examples
// add a style with random class name
const classes = o({
backgroundColor: '#FFF',
position: 'relative',
borderRadius: 10
});
<div className={classes}></div>
------------------------
// add a style with defined class name
const classes = o({
backgroundColor: '#FFF',
position: 'relative',
borderRadius: 10
}, 'myclass');
<div className={'myclass'}></div>