#Getting and setting element properties from Rust

2 messages · Page 1 of 1 (latest)

feral crescent
#

Hi, how would I go about setting something like an svg height and width based upon the available space? If I have a side with x width and I want an svg to take up the remaining space it would have to be done without css which means I need a handle to the svg. How do I get some sort of handle or reference after an element is rendered to get and set properties?

I do primarily target web but I would like to have the ability to target desktop as well.

odd dragon
#

If the "available space" is the entire parent container then height: 100% and/or width:100% as appropriate. If it is the space remaining after the space taken up by another siblings, then you can make the parent a flexbox container, and set flex-basis: auto;flex-grow: 0 on the fixed-size siblings and flex-basis: 0px;flex-grow: 1 on the SVG.