Skip to content

Commit 2bdf2ce

Browse files
stefanvjarrodmillman
authored andcommitted
Move shortcuts to right side, as in PDST
1 parent e79a747 commit 2bdf2ce

3 files changed

Lines changed: 25 additions & 18 deletions

File tree

assets/js/shortcuts.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ function setupShortcuts(shortcutDepth = 2) {
153153

154154
// Removes the shortcuts container if no shortcuts exist.
155155
// Also removes the 'Get Help' link.
156-
const shortcuts = Array.from(document.querySelectorAll("#shortcuts div"));
156+
const shortcuts = Array.from(
157+
document.querySelectorAll("#shortcuts div:not(#shortcuts-header)"),
158+
);
157159
if (shortcuts.length == 0) {
158160
const shortcutsContainer = document.getElementById("shortcuts-container");
159161
if (shortcutsContainer) {

assets/theme-css/shortcuts.css

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,21 @@
11
#shortcuts-container {
22
position: sticky;
33
align-self: flex-start;
4-
top: 6rem;
4+
margin-top: 3rem;
5+
top: 9rem; /* top + 3rem */
56
width: 100%;
67
max-width: 150px;
7-
margin: 75px 15px;
88
}
99

1010
#shortcuts {
1111
margin-top: 10px;
1212
}
1313

14+
#shortcuts-header {
15+
padding-left: calc(1rem + 2px);
16+
padding-bottom: 0.25rem;
17+
}
18+
1419
#shortcuts > div:not(.active) {
1520
margin-left: 2px;
1621
border-left: 1px solid var(--pst-color-text-base);
Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
<section class="content-padding flex-row">
2-
<div id="shortcuts-container">
3-
<div><i class="fa-solid fa-list"></i> On this page</div>
4-
<div id="shortcuts"></div>
2+
<div class="content-container">
3+
<div class="columns">
4+
<div class="column is-centered-tablet-portrait">
5+
<h1>{{ .Title }}</h1>
6+
</div>
57
</div>
6-
<div class="content-container">
7-
<div class="columns">
8-
<div class="column is-centered-tablet-portrait">
9-
<h1>{{ .Title }}</h1>
10-
</div>
11-
</div>
12-
{{ with partial "post_meta.html" . -}}
13-
<div class="post-meta">{{ . }}</div>
14-
{{- end }}
8+
{{ with partial "post_meta.html" . -}}
9+
<div class="post-meta">{{ . }}</div>
10+
{{- end }}
1511

16-
<div class="post-content">
17-
{{ .Content }}
18-
</div>
12+
<div class="post-content">
13+
{{ .Content }}
14+
</div>
15+
</div>
16+
<div id="shortcuts-container">
17+
<div id="shortcuts">
18+
<div id="shortcuts-header"><i class="fa-solid fa-list"></i> On this page</div>
1919
</div>
2020
</div>
2121
</section>

0 commit comments

Comments
 (0)