Skip to content

Commit 5dadad0

Browse files
MasssiveJuice08jackyzha0MarcRez33
authored
Update Quartz to 01fc26d (#93)
* fix: only apply z-index on left sidebar * fix: Reload graph after a theme change (closes #1380) (#1383) * FIX: Reload graph after a theme change * FIX: Reload graph after a theme change - comment updated * FIX: Reload graph after a theme change - comment updated * FIX: Reload graph after a theme change * fix: Reload graph after a theme change --------- Co-authored-by: Jacky Zhao <[email protected]> Co-authored-by: MarcRez33 <[email protected]>
1 parent 3369ec5 commit 5dadad0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

quartz/components/scripts/graph.inline.ts

+13
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,19 @@ document.addEventListener("nav", async (e: CustomEventMap["nav"]) => {
550550
addToVisited(simplifySlug(slug))
551551
await renderGraph("graph-container", slug)
552552

553+
// Function to re-render the graph when the theme changes
554+
const handleThemeChange = () => {
555+
renderGraph("graph-container", slug)
556+
}
557+
558+
// event listener for theme change
559+
document.addEventListener("themechange", handleThemeChange)
560+
561+
// cleanup for the event listener
562+
window.addCleanup(() => {
563+
document.removeEventListener("themechange", handleThemeChange)
564+
})
565+
553566
const container = document.getElementById("global-graph-outer")
554567
const sidebar = container?.closest(".sidebar") as HTMLElement
555568

quartz/styles/base.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ a {
172172
box-sizing: border-box;
173173
padding: 0 4rem;
174174
position: fixed;
175-
z-index: 1;
176175
@media all and (max-width: $fullPageWidth) {
177176
position: initial;
178177
flex-direction: row;
@@ -183,6 +182,7 @@ a {
183182
}
184183

185184
& .sidebar.left {
185+
z-index: 1;
186186
left: calc(calc(100vw - $pageWidth) / 2 - $sidePanelWidth);
187187
@media all and (max-width: $fullPageWidth) {
188188
gap: 0;

0 commit comments

Comments
 (0)