Skip to content

Commit

Permalink
Add a body class when the TOC component is used
Browse files Browse the repository at this point in the history
  • Loading branch information
malberts committed Oct 9, 2024
1 parent 07d9171 commit 6366f9e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion resources/styles/Components/Toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@

// Hide page TOC to prevent page content shift.
@include media-breakpoint-up(md) {
#bodyContent #toc {
.has-chameleon-toc #bodyContent #toc {
display: none;
}
}
2 changes: 2 additions & 0 deletions src/Components/Toc.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ public function getHtml(): string {
return '';
}

$this->getSkin()->getOutput()->addBodyClasses( 'has-chameleon-toc' );

// Add Top link.
$html = substr_replace( $html, '<ul><li><a class="nav-link top" href="#">(Top)</a></li></ul><ul>', strpos( $html, '<ul>' ), 4 );

Expand Down

0 comments on commit 6366f9e

Please sign in to comment.