Skip to content
/ web Public

Commit 32f5056

Browse files
committed
bug: fix sticky headers
1 parent bc390c4 commit 32f5056

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

layouts/components/MainContent.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const containContentValue = computed(() => containContent?.value ?? true);
2323
:open="rightSidebarOpen"
2424
@update:open="setRightSidebarOpen"
2525
side="right"
26-
class="!min-h-[calc(100svh-var(--header-height))]"
26+
class="min-h-0 h-full"
2727
>
2828
<SidebarMobileSync />
29-
<SidebarInset class="!min-h-[calc(100svh-var(--header-height))]">
29+
<SidebarInset class="overflow-visible min-h-0 h-full">
3030
<!-- todo fix bg color bg-muted/10 -->
3131
<div
3232
class="p-4 w-full self-center"
@@ -47,13 +47,14 @@ const containContentValue = computed(() => containContent?.value ?? true);
4747
<style scoped>
4848
/* Override SidebarProvider's --sidebar-height and --sidebar-width variables */
4949
.main-content-wrapper :deep(.group\/sidebar-wrapper) {
50-
--sidebar-height: calc(100svh - var(--header-height)) !important;
50+
--sidebar-height: 100% !important;
5151
--sidebar-width: 22rem !important;
52+
min-height: 0 !important;
5253
}
5354
5455
/* Define sidebar height variable for right sidebar group */
5556
.main-content-wrapper :deep(.main-content-sidebar.group[data-side="right"]) {
56-
--sidebar-height: calc(100svh - var(--header-height));
57+
--sidebar-height: 100%;
5758
}
5859
5960
/* Override the fixed sidebar div positioning */
@@ -62,7 +63,7 @@ const containContentValue = computed(() => containContent?.value ?? true);
6263
.main-content-sidebar.group[data-side="right"]
6364
> div[class*="fixed"][class*="inset-y-0"]
6465
) {
65-
top: var(--header-height) !important;
66+
top: 0 !important;
6667
bottom: auto !important;
6768
}
6869
</style>

layouts/components/TopNav.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const { setRightSidebarOpen, rightSidebarOpen } = useRightSidebar();
4040

4141
<template>
4242
<nav
43-
class="text-sm w-full bg-[#28282b] border-t border-[#3a3a3d] border-b-2 border-[#18181b] shadow-lg flex items-center justify-between px-4 z-50 relative sticky top-0"
43+
class="text-sm w-full bg-[#28282b] border-t border-[#3a3a3d] border-b-2 border-[#18181b] shadow-lg flex items-center justify-between px-4 z-50 sticky top-0"
4444
>
4545
<div class="flex items-center gap-2 relative">
4646
<NuxtLink

layouts/default.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,13 @@ provide("containContent", containContent);
4343
<SidebarProvider>
4444
<AppSidebar v-if="showLeftNav" />
4545

46-
<SidebarInset>
46+
<SidebarInset class="flex flex-col overflow-auto" style="height: 100svh">
4747
<TopNav v-if="!showLeftNav" />
4848
<AppHeader class="px-6" v-if="showLeftNav" />
4949

50-
<div class="flex flex-1 flex-col">
51-
<MainContent>
52-
<slot></slot>
53-
</MainContent>
54-
</div>
50+
<MainContent class="flex-1">
51+
<slot></slot>
52+
</MainContent>
5553
</SidebarInset>
5654
</SidebarProvider>
5755

0 commit comments

Comments
 (0)