The Resize Observer API can be used to observe changes to size of Element's content rect.
Docs: https://developers.google.com/web/updates/2016/10/resizeobserver
Samples: https://ebidel.github.io/demos/dom_resize_events.html https://jsfiddle.net/atotic/mr47wt1a/