made left sidebar sticky and higlight current chapter

This commit is contained in:
interlope committed 2026-05-29 17:55:59 +02:00
1 parent bdfb8e74bb
commit 353202665c
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -1033,8 +1033,9 @@ footer.footer-modern a:hover {
.toc-sidebar { .toc-sidebar {
margin-top: var(--space-xl); margin-top: var(--space-xl);
position: sticky; position: sticky;
top: var(--space-lg); /* 56px = fixed navbar height; extra gap so the ToC doesn't hug it */
max-height: calc(100vh - var(--space-xl)); top: calc(56px + var(--space-sm));
max-height: calc(100vh - 56px - var(--space-md));
overflow-y: auto; overflow-y: auto;
font-size: var(--font-size-sm); font-size: var(--font-size-sm);
} }
+3 -2
View File
@@ -106,8 +106,9 @@
<?php if ($hasHeadings): ?> <?php if ($hasHeadings): ?>
<!-- Left ToC Sidebar — visible on md+ only; hidden on mobile --> <!-- Left ToC Sidebar — visible on md+ only; hidden on mobile.
<div class="col-md-3 d-none d-md-block align-self-start"> No align-self-start so the column stretches to article height, enabling sticky. -->
<div class="col-md-3 d-none d-md-block">
<?php include(THEME_DIR_PHP.'toc.php'); ?> <?php include(THEME_DIR_PHP.'toc.php'); ?>
</div> </div>