svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.01k stars 1.07k forks source link

style() doesn't write style correctly #1186

Closed rossburton closed 3 years ago

rossburton commented 3 years ago

If I call draw.style() to create a top-level stylesheet:

draw.style(".header", {fill: "black", font: "20px ff-brokenscript-bc-web, serif"});

This results in the following elements in the SVG:

<style fill="black" font="20px ff-brokenscript-bc-web, serif">.header</style>

I'd have expected something more like:

<style>
.header { fill: black; font: 20px ff-brokenscript-bc-web, serif; }
</style>
Fuzzyma commented 3 years ago

Fixed in master!