UNPKG

fabric

Version:

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

1 lines 801 B
{"version":3,"file":"dom_style.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,SAAS,SAAsB,QAAgC;CAC7E,MAAM,eAAe,QAAQ;AAC7B,KAAI,CAAC,aACH;AAEF,QAAO,QAAQ,OAAO,CAAC,SAAS,CAAC,UAAU,WACzC,aAAa,YAAY,UAAU,MAAM,CAC1C"}