Some checks failed
No response / noResponse (push) Has been cancelled
CI / Continuous releases (push) Has been cancelled
CI / test-dev (macos-latest) (push) Has been cancelled
CI / test-dev (ubuntu-latest) (push) Has been cancelled
CI / test-dev (windows-latest) (push) Has been cancelled
Maintenance / main (push) Has been cancelled
Scorecards supply-chain security / Scorecards analysis (push) Has been cancelled
CodeQL / Analyze (push) Has been cancelled
27 lines
739 B
TypeScript
27 lines
739 B
TypeScript
export function openSidebar() {
|
|
if (typeof window !== 'undefined') {
|
|
document.body.style.overflow = 'hidden';
|
|
document.documentElement.style.setProperty('--SideNavigation-slideIn', '1');
|
|
}
|
|
}
|
|
|
|
export function closeSidebar() {
|
|
if (typeof window !== 'undefined') {
|
|
document.documentElement.style.removeProperty('--SideNavigation-slideIn');
|
|
document.body.style.removeProperty('overflow');
|
|
}
|
|
}
|
|
|
|
export function toggleSidebar() {
|
|
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
const slideIn = window
|
|
.getComputedStyle(document.documentElement)
|
|
.getPropertyValue('--SideNavigation-slideIn');
|
|
if (slideIn) {
|
|
closeSidebar();
|
|
} else {
|
|
openSidebar();
|
|
}
|
|
}
|
|
}
|