UNPKG

fabric

Version:

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

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