Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions layouts/compliance/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="container">

<div class="row">
{{ if isset .Params "toc" }}
{{ if .Params.toc }}
<div class="col-md-9">
{{ else }}
<div class="col-md-12">
Expand All @@ -37,16 +37,9 @@
</div>

</div>
{{ if isset .Params "toc" }}
<div class="col-md-3">
<div class="panel sidebar-menu">
<div class="panel-heading">
<h3 class="panel-title">Table of Content</h3>
</div>
<div class="panel-body">
{{ .TableOfContents }}
</div>
</div>
{{ if .Params.toc }}
<div class="col-md-3 page-toc-column">
{{ partial "table-of-contents.html" . }}
</div>
{{ end }}

Expand Down
15 changes: 4 additions & 11 deletions layouts/page/single.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<div class="container">

<div class="row">
{{ if isset .Params "toc" }}
{{ if .Params.toc }}
<div class="col-md-9">
{{ else }}
<div class="col-md-12">
Expand All @@ -37,16 +37,9 @@
</div>

</div>
{{ if isset .Params "toc" }}
<div class="col-md-3">
<div class="panel sidebar-menu">
<div class="panel-heading">
<h3 class="panel-title">Table of Content</h3>
</div>
<div class="panel-body">
{{ .TableOfContents }}
</div>
</div>
{{ if .Params.toc }}
<div class="col-md-3 page-toc-column">
{{ partial "table-of-contents.html" . }}
</div>
{{ end }}

Expand Down
9 changes: 9 additions & 0 deletions layouts/partials/table-of-contents.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<aside class="page-toc" aria-labelledby="page-toc-title">
<div class="page-toc__heading">
<span class="page-toc__eyebrow">Navigate</span>
<h2 id="page-toc-title">On this page</h2>
</div>
<div class="page-toc__content">
{{ .TableOfContents }}
</div>
</aside>
101 changes: 101 additions & 0 deletions static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,98 @@ h3.text-uppercase {
overflow: hidden;
}

/* In-page navigation */
.page-toc {
background: var(--surface);
border: 1px solid var(--line);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
overflow: hidden;
position: sticky;
top: 104px;
Comment on lines +515 to +516

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Apply sticky positioning to the full-height column

On desktop pages whose article is taller than the TOC, this element will not remain visible while scrolling. Both updated layouts place .page-toc inside a floated Bootstrap .col-md-3; that column is only as tall as the TOC itself, so the sticky element immediately reaches the bottom constraint of its containing block and behaves like a static element. Apply the sticky positioning to .page-toc-column itself or otherwise stretch that column to the row's article height.

Useful? React with 👍 / 👎.

}

.page-toc__heading {
border-bottom: 1px solid var(--line);
padding: 20px 22px 17px;
position: relative;
}

.page-toc__heading::after {
background: var(--primary-accent);
border-radius: 99px;
bottom: -2px;
content: "";
height: 3px;
left: 22px;
position: absolute;
width: 44px;
}

.page-toc__eyebrow {
color: var(--ink-muted);
display: block;
font-size: 11px;
font-weight: 700;
letter-spacing: 0.12em;
margin-bottom: 3px;
text-transform: uppercase;
}

#content .page-toc__heading h2 {
font-size: 18px;
letter-spacing: -0.01em;
margin: 0;
}

.page-toc__content {
font-size: 14px;
line-height: 1.45;
max-height: calc(100vh - 220px);
overflow-y: auto;
padding: 12px 10px 14px;
}

.page-toc nav > ul,
.page-toc nav > ol {
margin: 0;
}

.page-toc ul,
.page-toc ol {
list-style: none;
padding-left: 0;
}

.page-toc li {
margin: 2px 0;
}

.page-toc li li {
border-left: 1px solid var(--line);
margin-left: 13px;
padding-left: 9px;
}

.page-toc a {
border-radius: 7px;
color: #3d505b;
display: block;
overflow-wrap: anywhere;
padding: 7px 10px;
text-decoration: none;
}

.page-toc a:hover,
.page-toc a:focus {
background: var(--primary-accent-light);
color: var(--primary-accent-dark);
}

#content :is(h2, h3, h4, h5, h6)[id] {
scroll-margin-top: 110px;
}

/* Footer */
#footer {
background: #102633;
Expand Down Expand Up @@ -584,6 +676,15 @@ ul ul {
.box-simple {
min-height: 0;
}

.page-toc {
margin-top: 36px;
position: static;
}

.page-toc__content {
max-height: none;
}
}

@media (max-width: 767px) {
Expand Down
Loading