tiby312 / poloto-project

MIT License
158 stars 10 forks source link

Background color #154

Closed Icelk closed 2 years ago

Icelk commented 2 years ago

Hi! Since updating from 6.1 to 7.1, the background colour of the SVG disappeared (outside the viewBox). In Firefox, I see the background-color property was removed from the root element. It seems like it's been replaced by a very large circle. Why is this?

tiby312 commented 2 years ago

The background css property is aparently not a part of the svg spec.

https://stackoverflow.com/questions/11293026/default-background-color-of-svg-root-element

You can style the giant circle no problem. You can also probably set the fill color of the giant circle to be transparent making any background show up if svg is embeded

Icelk commented 2 years ago

Thanks for the answer. Still think it's a bit of a regression for the background outside the viewbox of the SVG to become white when opening with a browser.

tiby312 commented 2 years ago

Yeah that's true, but I guess it's more correct behavior according to svg spec. What drove me to change it was I was trying to render to png using the resvg crate and it didnt support it. To get the same behavior would have to use html and inline unfortunately.

Icelk commented 2 years ago

I agree 👍