Converts an object to (minified) css
Create a css rule of an object of objects.
const objectToCss = require('convert-to-css');
const input = {
'.foo': {
padding: 10,
},
bar: {
margin: '10em',
},
};
objectToCss.createCssRule(input);
// result: ".foo{padding:10px}bar{margin:10em}"
objectToCss.createCssRule({foo:{}});
// result: ""
Create a css class of an object of objects.
const objectToCss = require('convert-to-css');
const input = {
foo: {
padding: 10,
},
bar: {
margin: '10em',
},
};
objectToCss.createCssClasses(input);
// result: ".foo{padding:10px}.bar{margin:10em}"
Create a css identifiers of an object of objects.
const objectToCss = require('convert-to-css');
const input = {
foo: {
padding: 10,
},
bar: {
margin: '10em',
},
};
objectToCss.createCssIdentifiers(input);
// result: "#foo{padding:10px}#bar{margin:10em}"
Create a css rule properties of an object.
const objectToCss = require('convert-to-css');
const input = {
padding: 10,
margin: '10em',
};
objectToCss.createCssProperties(input);
// result: "padding:10px;margin:10em"
MIT © LSVH