fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
1 lines • 797 B
Source Map (JSON)
{"version":3,"file":"dom_style.min.mjs","names":[],"sources":["../../../../src/util/internals/dom_style.ts"],"sourcesContent":["// TODO this file needs to go away, cross browser style support is not fabricjs domain.\n\n/**\n * wrapper for setting element's style\n * @param {HTMLElement} element an HTMLElement\n * @param {Object} styles to apply to element\n */\nexport function setStyle(element: HTMLElement, styles: Record<string, string>) {\n const elementStyle = element.style;\n if (!elementStyle) {\n return;\n }\n Object.entries(styles).forEach(([property, value]) =>\n elementStyle.setProperty(property, value),\n );\n}\n"],"mappings":"AAOA,SAAgB,EAAS,EAAsB,EAAA,CAC7C,IAAM,EAAe,EAAQ,MACxB,GAGL,OAAO,QAAQ,EAAA,CAAQ,SAAA,CAAU,EAAU,KACzC,EAAa,YAAY,EAAU,EAAA,CAAA,CAAA,OAAA,KAAA"}