mirror of
https://github.com/aphrody-labs/base-ui.git
synced 2026-10-14 13:19:31 +00:00
11 lines
317 B
TypeScript
11 lines
317 B
TypeScript
/**
|
|
* Whether Base UI's scroll lock is active on the given document.
|
|
*/
|
|
export function isScrollLocked(doc: Document = document) {
|
|
return (
|
|
doc.documentElement.style.overflow === 'hidden' ||
|
|
doc.documentElement.hasAttribute('data-base-ui-scroll-locked') ||
|
|
doc.body.style.overflow === 'hidden'
|
|
);
|
|
}
|