UNPKG

reblend-ui

Version:

Utilities for creating robust overlay components

11 lines (9 loc) 287 B
/** * Get the width of the vertical window scrollbar if it's visible */ export default function getBodyScrollbarWidth(ownerDocument = document) { const window = ownerDocument.defaultView!; return Math.abs( window.innerWidth - ownerDocument.documentElement.clientWidth, ); }