object-string-to-css
v1.0.0
Published
Convert object or strings into valid CSS
Downloads
5
Readme
object-string-to-css
Convert object or strings into valid CSS
Install
$ npm install --save object-string-to-css
Usage
const objectStringToCSS = require('object-string-to-css');
objectStringToCSS({
width: 100,
display: "flex",
flexDirection: "column",
}, ".class")
/*
.class{
width: 100px;
display: flex;
flex-direction: column;
}
*/
API
function (string|object objectToChange, string selector): string
Throws when
- Invalid JSON
- Invalid Parameter type
FAQ
Why?
Makes migrating my projects faster
Help
If there is any problem with the package, please create an issue on github. Thanks!