Skip to content

Commit

Permalink
Do not open side drawer on top of window controls
Browse files Browse the repository at this point in the history
  • Loading branch information
kangasta committed Jun 4, 2024
1 parent 61aa9c5 commit 385636b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/Modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
open = false;
setTimeout(() => dispatch("close"), 125);
};
let windowControlsOnLeft = (navigator as any).windowControlsOverlay?.visible && (navigator as any).windowControlsOverlay?.getTitlebarAreaRect().left > 0;
</script>

<div class="backdrop" class:open />
<div
class="modal {position}"
class="modal {position} {windowControlsOnLeft ? 'window-controls-on-left' : ''}"
class:open
role="dialog"
aria-labelledby={titleId}
Expand Down Expand Up @@ -124,9 +126,12 @@
opacity: 1
transform: translateX(0)
h2
&.window-controls-on-left
@media (display-mode: window-controls-overlay)
margin-top: min(env(titlebar-area-height), 1em)
border-radius: 0 0.25em 0 0
height: calc(102vh - env(titlebar-area-height) - 1rem)
padding: 0 1em 2vh
top: calc(env(titlebar-area-height) + 1rem)
background: white
z-index: 4
Expand Down

0 comments on commit 385636b

Please sign in to comment.