UNPKG

@restart/ui

Version:

Utilities for creating robust overlay components

7 lines 275 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); }