UNPKG

fabric

Version:

Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.

21 lines (18 loc) 543 B
// TODO this file needs to go away, cross browser style support is not fabricjs domain. /** * wrapper for setting element's style * @param {HTMLElement} element an HTMLElement * @param {Object} styles to apply to element */ function setStyle(element, styles) { const elementStyle = element.style; if (!elementStyle) { return; } Object.entries(styles).forEach(_ref => { let [property, value] = _ref; return elementStyle.setProperty(property, value); }); } export { setStyle }; //# sourceMappingURL=dom_style.mjs.map