File tree 2 files changed +20
-24
lines changed
themes/fukasawa/components
2 files changed +20
-24
lines changed Original file line number Diff line number Diff line change @@ -151,13 +151,12 @@ function AsideLeft(props) {
151
151
< DarkModeButton />
152
152
</ section >
153
153
154
- < section className = 'sticky top-0 pt-12' >
154
+ < section className = 'sticky top-0 pt-12 flex flex-col max-h-screen ' >
155
155
< Catalog toc = { post ?. toc } />
156
156
< div className = 'flex justify-center' >
157
157
< div > { slot } </ div >
158
158
</ div >
159
159
</ section >
160
-
161
160
</ div >
162
161
</ div >
163
162
}
Original file line number Diff line number Diff line change @@ -54,35 +54,32 @@ const Catalog = ({ toc }) => {
54
54
55
55
// 目录自动滚动
56
56
const tRef = useRef ( null )
57
-
58
57
// 无目录就直接返回空
59
58
if ( ! toc || toc ?. length < 1 ) {
60
59
return < > </ >
61
60
}
62
-
63
- return < div id = 'catalog' >
61
+ return < div id = 'catalog' className = 'flex-1 flex-col flex overflow-hidden' >
64
62
< div className = 'w-full dark:text-gray-300 mb-2' > < i className = 'mr-1 fas fa-stream' /> { locale . COMMON . TABLE_OF_CONTENTS } </ div >
65
- < div className = 'h-96' >
66
- < nav ref = { tRef } className = 'h-full overflow-y-auto overscroll-none scroll-hidden text-black' >
67
- { toc . map ( ( tocItem ) => {
68
- const id = uuidToId ( tocItem . id )
69
- return (
70
- < a
71
- key = { id }
72
- href = { `#${ id } ` }
73
- className = { `notion-table-of-contents-item duration-300 transform font-light dark:text-gray-300
63
+ < nav ref = { tRef } className = 'flex-1 overflow-auto overscroll-none scroll-hidden text-black mb-6' >
64
+ { toc . map ( ( tocItem ) => {
65
+ const id = uuidToId ( tocItem . id )
66
+ return (
67
+ < a
68
+ key = { id }
69
+ href = { `#${ id } ` }
70
+ className = { `notion-table-of-contents-item duration-300 transform font-light dark:text-gray-300
74
71
notion-table-of-contents-item-indent-level-${ tocItem . indentLevel } ` }
72
+ >
73
+ < span style = { { display : 'inline-block' , marginLeft : tocItem . indentLevel * 16 } }
74
+ className = { `${ activeSection === id && ' font-bold text-red-400 underline' } ` }
75
+ title = { tocItem . text }
75
76
>
76
- < span style = { { display : 'inline-block' , marginLeft : tocItem . indentLevel * 16 } }
77
- className = { `${ activeSection === id && ' font-bold text-red-400 underline' } ` }
78
- >
79
- { tocItem . text }
80
- </ span >
81
- </ a >
82
- )
83
- } ) }
84
- </ nav >
85
- </ div >
77
+ { tocItem . text }
78
+ </ span >
79
+ </ a >
80
+ )
81
+ } ) }
82
+ </ nav >
86
83
</ div >
87
84
}
88
85
You can’t perform that action at this time.
0 commit comments