Ah, no, my question was more along the line of “How do I scale things via CSS” - I want to keep my UI perfectly in sync with the WebGL content on different resolutions.
After some experimentation, I figured it out https://playcanv.as/p/EgGnFGWQ
Top grey bar background, dark gray background, plane and cube are WebGL. Buttons, text and SVG are HTML/CSS. The top grey bar would obviously be done with HTML/CSS later on, this is just to check how well synchronized it stays. If you resize it, you see that it stays synchronized.
This is what I’m using for scaling: https://css-tricks.com/scaled-proportional-blocks-with-css-and-javascript
Thanks for getBoundingClientRect though, that might be useful later on!