Skip to content

Commit f0c53a1

Browse files
committed
Article Layout- Empty margin sidebar fix 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 675eeeb commit f0c53a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

news/changelog-1.5.md

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ All changes included in 1.5:
33
## HTML Format
44

55
- ([#8118](https://github.com/quarto-dev/quarto-cli/issues/8118)): Add support for `body-classes` to add classes to the document body.
6+
- ([#8311](https://github.com/quarto-dev/quarto-cli/issues/8311)): Correct z-order for margins with no contents
67

78
## Website
89

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)