UNPKG

fabric

Version:

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

3 lines (2 loc) 760 B
import{objectSpread2 as t}from"../../_virtual/_rollupPluginBabelHelpers.min.mjs";function r(r){const e=r.getElementsByTagName("style");let i,l;const n={};for(i=0,l=e.length;i<l;i++){const r=(e[i].textContent||"").replace(/\/\*[\s\S]*?\*\//g,"");""!==r.trim()&&r.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("{"),s={},o=e[1].trim().split(";").filter((function(t){return t.trim()}));for(i=0,l=o.length;i<l;i++){const t=o[i].split(":"),r=t[0].trim(),e=t[1].trim();s[r]=e}(r=e[0].trim()).split(",").forEach((r=>{""!==(r=r.replace(/^svg/i,"").trim())&&(n[r]=t(t({},n[r]||{}),s))}))}))}return n}export{r as getCSSRules}; //# sourceMappingURL=getCSSRules.min.mjs.map