Commit bb3e5f71 authored by Mark Otto's avatar Mark Otto
Browse files

Move table of contents to new sidebar, restyle it to be simpler

parent 6fdb8e6e
Showing with 50 additions and 20 deletions
+50 -20
// stylelint-disable selector-max-type, selector-max-compound-selectors // stylelint-disable selector-max-type, selector-max-compound-selectors
.bd-toc-wrap {
@include media-breakpoint-up(lg) {
@supports (position: sticky) {
position: sticky;
top: 5rem;
right: 0;
z-index: 2;
height: subtract(100vh, 7rem);
overflow-y: auto;
}
}
}
.bd-toc nav { .bd-toc nav {
padding-top: .125em; @include font-size(.875rem);
padding-bottom: .125em;
border-left: .25em solid $gray-200;
> ul { ul {
margin-bottom: 0; padding-left: 0;
list-style: none;
ul {
padding-left: 1rem;
margin-top: .25rem;
}
} }
li ul li { li {
margin-bottom: .25rem; margin-bottom: .25rem;
list-style-type: disc; }
a {
color: inherit;
} }
a:not(:hover) { a:not(:hover) {
......
...@@ -9,16 +9,18 @@ ...@@ -9,16 +9,18 @@
{{ partial "docs-navbar" . }} {{ partial "docs-navbar" . }}
{{ partial "docs-subnav" . }} {{ partial "docs-subnav" . }}
<div class="container-xl my-4"> <div class="container-xxl my-4">
<div class="row flex-xl-nowrap"> <div class="row flex-xl-nowrap">
<div class="col-md-3"> <div class="col-md-3 col-xl-2 bd-sidebar">
{{ partial "docs-sidebar" . }} {{ partial "docs-sidebar" . }}
</div> </div>
<main class="col-md-9 py-md-3 pl-md-5 bd-content"> <main class="col-md-9 col-xl-10 py-md-3 pl-md-5 bd-content">
<h1 class="bd-title" id="content">{{ .Title | markdownify }}</h1> <div class="col-xl-10 px-0">
<p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p> <h1 class="bd-title" id="content">{{ .Title | markdownify }}</h1>
{{ partial "ads" . }} <p class="bd-lead">{{ .Page.Params.Description | markdownify }}</p>
{{ partial "ads" . }}
</div>
{{ if .Page.Params.sections }} {{ if .Page.Params.sections }}
<div class="row my-5"> <div class="row my-5">
...@@ -33,14 +35,22 @@ ...@@ -33,14 +35,22 @@
</div> </div>
{{ end }} {{ end }}
{{ if (eq .Page.Params.toc true) }} <div class="row position-relative flex-xl-row-reverse">
<strong class="d-block h3 mt-5 mb-3">On this page</strong> <div class="col-xl-3">
<nav class="bd-toc mb-5 text-muted" aria-label="Secondary navigation"> {{ if (eq .Page.Params.toc true) }}
{{ .TableOfContents }} <div class="bd-toc-wrap pl-xl-3 text-muted">
</nav> <strong class="d-block h6 my-2 pb-2 border-bottom">On this page</strong>
{{ end }} <div class="bd-toc mb-5 mb-xl-0">
{{ .TableOfContents }}
</div>
</div>
{{ end }}
</div>
<div class="col-xl-9">
{{ .Content }}
</div>
</div>
{{ .Content }}
</main> </main>
</div> </div>
</div> </div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment