Open
Description
Currently getBoundingClientRect()
returns a DOMRect
with top
, right
, bottom
, and left
properties corresponding to the position and size of the element.
This is great, but if you are trying to use it for calculating layout positions in an RTL context, you have to do things like rect.right - window.innerWidth
to get the offset from the inline starting point.
Given that many CSS properties now support logical variants, it would be nice to have a function that returned the bounding box of an element using logical property names like blockStart
, blockEnd
, inlineStart
, and inlineEnd
.