Skip to content

Commit b42040b

Browse files
committed
ToC Fix
1 parent fd87584 commit b42040b

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

packages/ui-components/Containers/MetaBar/index.module.css

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313
[overflow-wrap:anywhere]
1414
lg:sticky
1515
lg:top-0
16-
lg:h-max
17-
lg:min-h-screen
16+
lg:max-h-screen
1817
lg:px-6
1918
dark:border-neutral-900;
2019

20+
scrollbar-width: none;
21+
2122
dl {
2223
@apply w-full;
2324
}
@@ -82,3 +83,17 @@
8283
dark:hidden;
8384
}
8485
}
86+
87+
.wrapper::-webkit-scrollbar {
88+
display: none;
89+
}
90+
91+
@media (min-width: 1024px) {
92+
.wrapper {
93+
max-height: calc(100vh - 4rem);
94+
padding-left: 1.5rem;
95+
padding-right: 1.5rem;
96+
position: sticky;
97+
top: 4rem;
98+
}
99+
}

packages/ui-components/Containers/MetaBar/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ const MetaBar: FC<MetaBarProps> = ({
4949
<ol>
5050
{filteredHeadings.map(head => (
5151
<li
52-
key={head.value}
52+
key={head.data.id}
5353
className={
5454
head.depth === 3 ? 'pl-2' : head.depth === 4 ? 'pl-4' : ''
5555
}
5656
>
57-
<Component href={`#${head?.data?.id}`}>
57+
<Component href={`#${head.data.id}`}>
5858
{' '}
5959
{head.value}
6060
</Component>

0 commit comments

Comments
 (0)