html-to-image
Version:
Generates an image from a DOM node using HTML5 canvas and SVG.
20 lines • 583 B
JavaScript
export function applyStyleWithOptions(clonedNode, options) {
const { style } = clonedNode;
if (options.backgroundColor) {
style.backgroundColor = options.backgroundColor;
}
if (options.width) {
style.width = `${options.width}px`;
}
if (options.height) {
style.height = `${options.height}px`;
}
const manual = options.style;
if (manual != null) {
Object.keys(manual).forEach((key) => {
style[key] = manual[key];
});
}
return clonedNode;
}
//# sourceMappingURL=applyStyleWithOptions.js.map