UNPKG

reblend-ui

Version:

Utilities for creating robust overlay components

11 lines (10 loc) 343 B
"use strict"; exports.__esModule = true; exports.default = getBodyScrollbarWidth; /** * Get the width of the vertical window scrollbar if it's visible */ function getBodyScrollbarWidth(ownerDocument = document) { const window = ownerDocument.defaultView; return Math.abs(window.innerWidth - ownerDocument.documentElement.clientWidth); }