Skip to content

Commit

Permalink
[AppLayout] Add overlapHeader to opt-in to overlapping main and header
Browse files Browse the repository at this point in the history
  • Loading branch information
techniq committed Jun 25, 2023
1 parent 7a7bd59 commit f32f946
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib/components/AppLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
export let navWidth = 240;
export let headerHeight = 64;
export let overlapHeader = false;
/** Control whether nav should be full height (default) or header should be full width */
export let headerFullWidth = false;
$: areas = headerFullWidth ? "'header header' 'aside main'" : "'aside header' 'aside main'";
Expand Down Expand Up @@ -39,6 +40,7 @@
classes.root,
$$props.class
)}
class:overlapHeader
>
<!-- Render backdrop first to fix stacking order with <aside> nav -->
{#if $showDrawer && temporaryDrawer}
Expand Down Expand Up @@ -77,7 +79,10 @@
.AppLayout :global(> main) {
grid-area: main;
overflow: auto;
/* Overlap under header to support background blur */
}
/* Overlap under header to support background blur */
.AppLayout.overlapHeader :global(> main) {
margin-top: calc(var(--headerHeight) * -1);
padding-top: var(--headerHeight);
}
Expand Down

1 comment on commit f32f946

@vercel
Copy link

@vercel vercel bot commented on f32f946 Jun 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.