text: let scrollBarSize;
  
  export function getScrollbarSize(shouldRecalculate) {
    if (!scrollBarSize || shouldRecalculate) {
      const scrollDiv = document.createElement('div');
  
      scrollDiv.style.position = 'absolute';
      scrollDiv.style.top = '-9999px';
      scrollDiv.style.width = '50px';
      scrollDiv.style.height = '50px';
      scrollDiv.style.overflow = 'scroll';
  
      document.body.appendChild(scrollDiv);
      scrollBarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
      document.body.removeChild(scrollDiv);
    }
  
    return scrollBarSize
  }
  