Convert a CSS class with its styles into a JavaScript object
$ npm install css-to-javascript --save
import csstojs from 'css-to-js'
var str = `
.header {
background: red;
border-top: 1px solid blue;
}
`
csstojs(str)
// => { header: { background: 'red', borderTop: '1px solid blue' } }
MIT © Ed Williams