wieslawsoltes / Svg.Skia

An SVG rendering library.
https://wieslawsoltes.github.io/Svg.Skia/
MIT License
424 stars 56 forks source link

Add support for var() CSS function #235

Open weltkante opened 1 week ago

weltkante commented 1 week ago

I don't know exactly what it does but I have some svg files with things like var(--color-text, #000) that fail to load. I can work around it by doing a regex-replacement throughout the svg, so its not blocking me, just reporting it in case you think this should be supported. If its out of scope feel free to close.

Example (which is just a black bar):

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000">
  <path d="M60 500h880" style="fill:none;stroke:var(--color-text, #000);stroke-linecap:square;stroke-miterlimit:2;stroke-width:68px" />
</svg>
wieslawsoltes commented 1 week ago

The CSS var is not supported https://developer.mozilla.org/en-US/docs/Web/CSS/var