I am trying to write a custom element that is resizable (I have done this before, but it was very messy).
In CSS, the properties right and bottom are measured in some unit from their referents, i.e. right is measured from the right side of the viewport, instead of the left like in the DOMRect, which you can get from an element with the method getBoundingClientRect.
I much prefer the DOMRect, but apparently the DOMRect is not live, i.e. you can't change the element with it.
Is it possible to set the properties right and bottom in CSS based on the top-left corner of the viewport, or is there a way to connect a DOMRect to an element, so that what I do to it, I also do to the element?
Thanks in advance.
Edit: I am creating a window module, like in an operating system. The problem with the CSS properties is that if I change the left property in CSS, element.style.left, that is, the width property doesn't change with it, naturally. And the right property is not based on the top-left corner, like in a DOMRect.
Is there any way to treat my element like a DOMRect, or is there a property in CSS that could help me?