Skip to content

Commit 622c8eb

Browse files
authored
Apppend for fix of sidebar (#539)
* Append for fix of sidebar * Fix
1 parent 2ebfe51 commit 622c8eb

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

docs/css/custom.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@
174174
header.md-header {
175175
z-index: 900 !important;
176176
}
177+
.md-sidebar {
178+
z-index: 1000 !important;
179+
}
177180
.md-overlay {
178181
z-index: 950 !important;
179182
}

docs/overrides/main.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,15 @@
55
<a href="{{ '../' ~ base_url }}">
66
<strong>Click here to go to latest.</strong>
77
</a>
8-
{% endblock %}
8+
<script>
9+
// A hacky way to recalculate positions of elements when the outdated banner is shown/hidden
10+
new MutationObserver(function(mutations) {
11+
mutations.forEach(function(mutation) {
12+
if (mutation.attributeName === "hidden") {
13+
document.body.style.border = '1px solid transparent';
14+
setTimeout(function() { document.body.style.border = undefined; }, 1);
15+
}
16+
});
17+
}).observe(document.querySelector("[data-md-component=outdated]"), { attributes: true });
18+
</script>
19+
{% endblock %}

0 commit comments

Comments
 (0)