Closed biojet1 closed 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
No. This libraray is no full blown rendering engine. We only look into the style to figure out font family and size