Skip to content

Commit c35a954

Browse files
committed
style: improve TOC vertical centering and sticky behavior
- Change content-wrapper align-items to stretch to ensure sidebar height matches content. - Remove top margin from toc-sidebar to improve alignment. - Use top: 50% and transform: translateY(-50%) for precise vertical centering of sticky TOC.
1 parent 792dc6e commit c35a954

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

assets/style.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ h1{
250250

251251
.content-wrapper {
252252
flex-direction: row;
253-
align-items: flex-start;
253+
align-items: stretch;
254254
gap: 2rem;
255255
}
256256

@@ -263,16 +263,16 @@ h1{
263263
width: 250px;
264264
flex-shrink: 0;
265265
order: 2;
266-
margin-top: 20px;
267266
border-left: 1px solid var(--border);
268267
padding-left: 1rem;
269268
font-size: 0.9em;
270269
}
271270

272271
.toc-sticky {
273272
position: sticky;
274-
top: 2rem;
275-
max-height: calc(100vh - 4rem);
273+
top: 50%;
274+
transform: translateY(-50%);
275+
max-height: 90vh;
276276
overflow-y: auto;
277277
}
278278
}

0 commit comments

Comments
 (0)