fix(desktop): replace dialog blur with theme-aware mask

This commit is contained in:
t8y2 committed 2026-07-30 17:41:29 +08:00
1 parent 343c81f305
commit 45d7db7a10
5 files changed
+6 -42

No files matched your search

@@ -1,24 +0,0 @@
const DIALOG_BACKDROP_CLASS = "dbx-dialog-backdrop-active";
let dialogBackdropObserver: MutationObserver | undefined;
function hasDialogOverlay(): boolean {
return Array.from(document.body.children).some((child) => child.matches('[data-slot="dialog-overlay"]') || child.querySelector('[data-slot="dialog-overlay"]'));
}
function syncDialogBackdrop() {
document.documentElement.classList.toggle(DIALOG_BACKDROP_CLASS, hasDialogOverlay());
}
export function startDialogBackdropSync() {
if (typeof document === "undefined" || dialogBackdropObserver) return;
dialogBackdropObserver = new MutationObserver(syncDialogBackdrop);
dialogBackdropObserver.observe(document.body, { childList: true });
syncDialogBackdrop();
}
export function stopDialogBackdropSync() {
dialogBackdropObserver?.disconnect();
dialogBackdropObserver = undefined;
document.documentElement.classList.remove(DIALOG_BACKDROP_CLASS);
}