You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
815 B

1 year ago
var getStyle = function (object) {
var styleList = [];
if (object.width) {
styleList.push('width:' + object.width);
}
styleList.push(object.height ? 'height:' + object.height : 'height:16px');
if (object.background) {
styleList.push('background:' + object.background);
}
if (object.backgroundColor) {
styleList.push('background-color:' + object.backgroundColor);
}
if (object.margin) {
styleList.push('margin:' + object.margin);
}
if (object.marginRight) {
styleList.push('margin-right:' + object.marginRight);
}
if (object.marginLeft) {
styleList.push('margin-left:' + object.marginLeft);
}
if (object.borderRadius) {
styleList.push('border-radius:' + object.borderRadius);
}
return styleList.join(';');
};
module.exports = {
getStyle: getStyle,
};