Skip to content

Commit 1e8ad93

Browse files
Update ToC getting hidden behind SubNavBar on scroll. (#2555)
Signed-off-by: bgravenorst <[email protected]> Co-authored-by: Mohammad Shahbaz Alam <[email protected]>
1 parent f764bb1 commit 1e8ad93

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/scss/theme/_toc.scss

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1-
.tableOfContents_node_modules-\@docusaurus-theme-classic-lib-theme-TOC-styles-module {
1+
/* Target ToC container using attribute selector for CSS modules compatibility */
2+
[class*='tableOfContents'] {
23
margin-top: -3rem;
3-
top: calc(var(--ifm-navbar-height) + 2rem) !important;
4+
top: calc(var(--ifm-navbar-height) + 4rem) !important;
5+
}
6+
7+
/* Increase offset when SubNavBar is present to clear the sticky banner */
8+
body:has([class*='subNavBar']) [class*='tableOfContents'] {
9+
top: calc(var(--ifm-navbar-height) + 9rem) !important;
410
}
511

612
.table-of-contents {

0 commit comments

Comments
 (0)