export const getViewport = () => ({
  height: window.innerHeight || document.documentElement.offsetHeight,
  width: window.innerWidth || document.documentElement.offsetWidth,
});

export const isElementOverflowing = element =>
  element.clientWidth < element.scrollWidth || element.clientHeight < element.scrollHeight;

export const getViewport = () => ({
  height: window.innerHeight || document.documentElement.offsetHeight,
  width: window.innerWidth || document.documentElement.offsetWidth,
});

export const isElementOverflowingX = element =>
  element.clientWidth < element.scrollWidth;

export const isElementOverflowingY = element =>
  element.clientHeight < element.scrollHeight;

Split up util function to detect horizontal & vertical overflowing separately
Split up util function to detect horizontal & vertical overflowing separately
