Skip to content

Commit 0dd46e3

Browse files
committed
Improve reader mode sidebar behavior
- don’t leave scrollable sidebar when collapsed - improve alignment of button
1 parent 5b78d13 commit 0dd46e3

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/resources/formats/html/bootstrap/_bootstrap-rules.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1395,7 +1395,6 @@ div.callout.callout-style-default > .callout-header {
13951395
margin-bottom: -0.2rem;
13961396
}
13971397

1398-
.sidebar-tools-main .quarto-reader-toggle .bi::before,
13991398
.sidebar-tools-main .quarto-color-scheme-toggle .bi::before {
14001399
padding-top: 0.2rem;
14011400
margin-bottom: -0.2rem;

src/resources/formats/html/quarto.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
275275
const convertToMenu = () => {
276276
for (const child of el.children) {
277277
child.style.opacity = 0;
278+
child.style.display = "none";
278279
}
279280

280281
const toggleContainer = window.document.createElement("div");
@@ -312,6 +313,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
312313

313314
const clone = child.cloneNode(true);
314315
clone.style.opacity = 1;
316+
clone.style.display = null;
315317
toggleContents.append(clone);
316318
}
317319
toggleContents.style.height = "0px";
@@ -376,6 +378,7 @@ window.document.addEventListener("DOMContentLoaded", function (_event) {
376378
const convertToSidebar = () => {
377379
for (const child of el.children) {
378380
child.style.opacity = 1;
381+
clone.style.display = null;
379382
}
380383

381384
const placeholderEl = window.document.getElementById(

0 commit comments

Comments
 (0)