From 1ae9910b34cfe5f8fbf5e00bb8d52bfb94bbb45e Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:47:20 +0000 Subject: [PATCH 1/2] docs: fix mermaid diagram visibility in dark mode Closes #783 --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 0b9ba7a4..ba3b538a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,7 +40,7 @@ "smartquotes", "deflist", ] -mermaid_init_js = "mermaid.initialize({startOnLoad:true,theme:'neutral'});" +mermaid_init_js = "mermaid.initialize({startOnLoad:true,theme:document.documentElement.dataset.theme==='dark'||(window.matchMedia&&window.matchMedia('(prefers-color-scheme:dark)').matches)?'dark':'neutral'});" ogp_image = "_static/structlog_logo.png" From 73ce735fad931de52f0d1da9aeb4533ba64599ad Mon Sep 17 00:00:00 2001 From: Zakir Jiwani <108548454+JiwaniZakir@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:48:13 +0000 Subject: [PATCH 2/2] docs: simplify mermaid dark mode detection Use only data-theme attribute check instead of also probing prefers-color-scheme via matchMedia. Split the string across lines for readability. --- docs/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ba3b538a..4b95b57f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -40,7 +40,10 @@ "smartquotes", "deflist", ] -mermaid_init_js = "mermaid.initialize({startOnLoad:true,theme:document.documentElement.dataset.theme==='dark'||(window.matchMedia&&window.matchMedia('(prefers-color-scheme:dark)').matches)?'dark':'neutral'});" +mermaid_init_js = ( + "mermaid.initialize({startOnLoad:true," + "theme:document.documentElement.dataset.theme==='dark'?'dark':'neutral'});" +) ogp_image = "_static/structlog_logo.png"