Skip to content

Commit f349d7e

Browse files
authored
fix: Allow ToC to scroll independently of page content (#7754)
* ToC Fix * Fix: replaced raw css with tailwind * Restored packages/ui-components/Containers/MetaBar/index.tsx * Replaced display:none with @apply hidden * Fix: not all elements were being rendered * Removed the redundant scrollbar styles * fix: metabar no longer has a short length * fix: metabar length fix * fix: chromatic diff * fix: removed the added padding * fix: removed the additional p-4 * added global variable for height
1 parent fdcc668 commit f349d7e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,26 @@
66
flex-col
77
items-start
88
gap-8
9-
overflow-y-auto
109
border-neutral-200
1110
px-4
1211
py-6
1312
[overflow-wrap:anywhere]
1413
lg:sticky
1514
lg:top-0
16-
lg:h-max
17-
lg:min-h-screen
15+
lg:max-h-screen
1816
lg:px-6
1917
dark:border-neutral-900;
2018

2119
dl {
22-
@apply w-full;
20+
@apply flex
21+
w-full
22+
flex-col
23+
gap-1.5
24+
pb-12
25+
[scrollbar-width:none]
26+
lg:max-h-[calc(100vh-var(--header-height))]
27+
lg:overflow-y-auto
28+
[&::-webkit-scrollbar]:hidden;
2329
}
2430

2531
dt {
@@ -55,6 +61,7 @@
5561

5662
ol {
5763
@apply flex
64+
w-full
5865
list-none
5966
flex-col
6067
gap-1.5

packages/ui-components/styles/index.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
color utility to any element that depends on these defaults.
2323
*/
2424
@layer base {
25+
:root {
26+
--header-height: calc(var(--spacing, 0.25rem) * 16);
27+
}
28+
2529
*,
2630
::after,
2731
::before,

0 commit comments

Comments
 (0)