svgdotjs / svgdom

Straightforward DOM implementation to make SVG.js run headless on Node.js
MIT License
273 stars 54 forks source link

are stylesheets supported #78

Closed biojet1 closed 3 years ago

biojet1 commented 3 years ago
<svg viewBox="0 0 10 10" xmlns="http://www.w3.org/2000/svg">
  <style>    circle {      fill: gold;      stroke: maroon;      stroke-width: 2px;    }  </style>
  <circle id="maru" cx="5" cy="5" r="4" />
</svg>
 const maru = document.querySelector('#maru');
 const style = window.getComputedStyle(maru);
 console.log(style.getPropertyValue('fill')); // <- null
Fuzzyma commented 3 years ago

No. This libraray is no full blown rendering engine. We only look into the style to figure out font family and size