@@ -49,15 +49,15 @@ export function TOC({ toc, filePath }: TOCProps): ReactElement {
49
49
block : 'center' ,
50
50
inline : 'center' ,
51
51
scrollMode : 'always' ,
52
- boundary : tocRef . current
52
+ boundary : tocRef . current ! . parentElement
53
53
} )
54
54
}
55
55
} , [ activeSlug ] )
56
56
57
57
return (
58
58
< div
59
59
className = { cn (
60
- 'nextra-scrollbar _sticky _top-16 _overflow-y-auto _pr -4 _pt-6 _text-sm [hyphens:auto]' ,
60
+ 'nextra-scrollbar _sticky _top-16 _overflow-y-auto _px -4 _pt-6 _text-sm [hyphens:auto]' ,
61
61
'_max-h-[calc(100vh-var(--nextra-navbar-height)-env(safe-area-inset-bottom))] ltr:_-mr-4 rtl:_-ml-4'
62
62
) }
63
63
>
@@ -74,16 +74,16 @@ export function TOC({ toc, filePath }: TOCProps): ReactElement {
74
74
className = { cn (
75
75
{
76
76
2 : '_font-semibold' ,
77
- 3 : 'ltr:_pl -4 rtl:_pr -4' ,
78
- 4 : 'ltr:_pl -8 rtl:_pr -8' ,
79
- 5 : 'ltr:_pl -12 rtl:_pr -12' ,
80
- 6 : 'ltr:_pl -16 rtl:_pr -16'
77
+ 3 : 'ltr:_ml -4 rtl:_mr -4' ,
78
+ 4 : 'ltr:_ml -8 rtl:_mr -8' ,
79
+ 5 : 'ltr:_ml -12 rtl:_mr -12' ,
80
+ 6 : 'ltr:_ml -16 rtl:_mr -16'
81
81
} [ depth ] ,
82
- '_inline-block _transition-colors _subpixel-antialiased' ,
82
+ '_block _transition-colors _subpixel-antialiased' ,
83
83
activeAnchor [ id ] ?. isActive
84
84
? '_text-primary-600 contrast-more:!_text-primary-600'
85
85
: '_text-gray-500 hover:_text-gray-900 dark:_text-gray-400 dark:hover:_text-gray-300' ,
86
- 'contrast-more:_text-gray-900 contrast-more:_underline contrast-more:dark:_text-gray-50 _w-full _break-words'
86
+ 'contrast-more:_text-gray-900 contrast-more:_underline contrast-more:dark:_text-gray-50 _break-words'
87
87
) }
88
88
>
89
89
{ removeLinks ( value ) }
@@ -98,7 +98,8 @@ export function TOC({ toc, filePath }: TOCProps): ReactElement {
98
98
< div
99
99
className = { cn (
100
100
hasHeadings && 'nextra-toc-footer _mt-8 _pt-8' ,
101
- '_sticky _bottom-0 _flex _flex-col _items-start _gap-2 _pb-8'
101
+ '_sticky _bottom-0 _flex _flex-col _items-start _gap-2 _pb-8' ,
102
+ '_-mx-1 _px-1' // to hide focused toc links
102
103
) }
103
104
>
104
105
{ themeConfig . feedback . content ? (
0 commit comments