Support CSS calc()
Can librsvg support SVG width attributes with calc? We're looking to use this functionality in our inhouse stuff that relies on Sharp (which depends on librsvg) and can't find a way to circumvent it.
In the code, I've moved the lines 40px to the right, however I want to restrain the lines in the viewbox without overflow. Using width="calc(100%-40px)" does not seem to work as intended through the library.
It looks like chrome supports usage of this on SVG attributes, and I'm wondering if it's part of SVG spec, can we support it in librsvg?
https://jsfiddle.net/ywtobazc/1/
<svg overflow="visible" height="100%" width="100%">
<svg viewBox="0 0 300 100" preserveAspectRatio="none" x="40px" width="calc(100% - 40px)">
<path
d="M 0 75 M 0 75 L 75 50 L 150 15 L 225 67 L 300 67 L 300 67"
stroke-width="3"
stroke="red"
fill="transparent"
vector-effect="non-scaling-stroke"
></path>
<path
d="M 0 92 M 0 92 L 75 72 L 150 80 L 225 50 L 300 50 L 300 50"
stroke-width="3"
stroke="blue"
fill="transparent"
></path>
</svg>
</svg>
Edited by Federico Mena Quintero