fabric
Version:
Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.
3 lines (2 loc) • 746 B
JavaScript
import{objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.min.mjs";function r(r){const e=r.getElementsByTagName("style"),i={};for(let r=0;r<e.length;r++){const l=(e[r].textContent||"").replace(/\/\*[\s\S]*?\*\//g,"");""!==l.trim()&&l.split("}").filter(((t,r,e)=>e.length>1&&t.trim())).forEach((r=>{if((r.match(/{/g)||[]).length>1&&r.trim().startsWith("@"))return;const e=r.split("{"),l={},n=e[1].trim().split(";").filter((function(t){return t.trim()}));for(let t=0;t<n.length;t++){const r=n[t].split(":"),e=r[0].trim(),i=r[1].trim();l[e]=i}(r=e[0].trim()).split(",").forEach((r=>{""!==(r=r.replace(/^svg/i,"").trim())&&(i[r]=t(t({},i[r]||{}),l))}))}))}return i}export{r as getCSSRules};
//# sourceMappingURL=getCSSRules.min.mjs.map