Skip to content

Commit 69e935d

Browse files
committed
Article Layout: Push completely empty margin sidebar to the bottom of z-order
Since the margin element has no children, we can safely push it to the bottom (and in fact, we need to in order to ensure that the links and other elements in the margin are clickable). Fixes #8311
1 parent c321593 commit 69e935d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/format/html/format-html-bootstrap.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -1058,8 +1058,11 @@ function bootstrapHtmlFinalizer(format: Format, flags: PandocFlags) {
10581058
// then lower the z-order so everything else can get on top
10591059
// of the sidebar
10601060
const isFullLayout = format.metadata[kPageLayout] === "full";
1061-
if (!hasMarginContent && isFullLayout && !hasRightContent) {
1062-
const marginSidebarEl = doc.getElementById("quarto-margin-sidebar");
1061+
const marginSidebarEl = doc.getElementById("quarto-margin-sidebar");
1062+
if (
1063+
(!hasMarginContent && isFullLayout && !hasRightContent) ||
1064+
marginSidebarEl?.childElementCount === 0
1065+
) {
10631066
marginSidebarEl?.classList.add("zindex-bottom");
10641067
}
10651068
return Promise.resolve();

0 commit comments

Comments
 (0)