Skip to content

Commit de4e67b

Browse files
authored
Mobile styles (#408)
* various mobile nav fixes * fix transition * fixes * simplify a whole bunch of stuff, have more consistent drop shadow * simplify * fix * fix * fixes
1 parent db57632 commit de4e67b

File tree

8 files changed

+270
-359
lines changed

8 files changed

+270
-359
lines changed

packages/site-kit/src/lib/actions/click-outside.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

packages/site-kit/src/lib/actions/focus-outside.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
export { click_outside } from './click-outside';
2-
export { focus_outside } from './focus-outside';
31
export { focusable_children, trap } from './focus';
42
export { legacy_details } from './legacy-details';
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script lang="ts">
2+
import { fade } from 'svelte/transition';
3+
4+
let { onclose }: { onclose?: () => void } = $props();
5+
</script>
6+
7+
<div
8+
transition:fade={{ duration: 100 }}
9+
class="modal-overlay"
10+
aria-hidden="true"
11+
onclick={onclose}
12+
></div>
13+
14+
<style>
15+
.modal-overlay {
16+
position: fixed;
17+
top: 0;
18+
left: 0;
19+
z-index: 99;
20+
opacity: 0.7;
21+
pointer-events: auto;
22+
width: 100%;
23+
height: 100%;
24+
height: 100dvh;
25+
background: var(--sk-back-1);
26+
}
27+
</style>

packages/site-kit/src/lib/components/Shell.svelte

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The main shell of the application. It provides a slot for the top navigation, th
1010
import '../styles/index.css';
1111
import Icons from './Icons.svelte';
1212
import type { Snippet } from 'svelte';
13+
import ModalOverlay from './ModalOverlay.svelte';
1314
1415
let {
1516
nav_visible = true,
@@ -36,7 +37,9 @@ The main shell of the application. It provides a slot for the top navigation, th
3637
{@render top_nav?.()}
3738
{/if}
3839

39-
<div class="modal-overlay" class:visible={$overlay_open} aria-hidden="true"></div>
40+
{#if $overlay_open}
41+
<ModalOverlay />
42+
{/if}
4043

4144
<main id="main">
4245
{@render children?.()}
@@ -47,28 +50,6 @@ The main shell of the application. It provides a slot for the top navigation, th
4750
</div>
4851

4952
<style>
50-
.modal-overlay {
51-
position: fixed;
52-
top: 0;
53-
left: 0;
54-
z-index: 99;
55-
56-
opacity: 0;
57-
pointer-events: none;
58-
59-
width: 100%;
60-
height: 100%;
61-
height: 100dvh;
62-
63-
background: var(--sk-back-1);
64-
transition: opacity 0.4s cubic-bezier(0.23, 1, 0.32, 1);
65-
}
66-
67-
.modal-overlay.visible {
68-
opacity: 0.7;
69-
pointer-events: auto;
70-
}
71-
7253
main {
7354
position: relative;
7455
margin: 0 auto;

0 commit comments

Comments
 (0)