From a98c685b182fceb34cac75c95e27690b5a9e6086 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Sat, 18 Jul 2026 12:07:31 +0200 Subject: [PATCH] doc/style.css: add dark mode to sidebar --- doc/style.css | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/doc/style.css b/doc/style.css index 112491a4b78c..5ca664ed61f7 100644 --- a/doc/style.css +++ b/doc/style.css @@ -479,6 +479,8 @@ div.appendix .variablelist .term { nav.toc-sidebar { height: 100%; padding: 0 1rem 2rem; + background-color: var(--background); + color: var(--main-text-color); } /* menu button, shown on mobile, hidden on desktop */ @@ -546,7 +548,7 @@ nav.toc-sidebar a { border-color 120ms ease; } nav.toc-sidebar a:hover { - background-color: #f2f2f2; + background-color: #f2f2f2 !important; } nav.toc-sidebar a.active { @@ -559,6 +561,22 @@ nav.toc-sidebar a.active-trail { background-color: #e8e8e8; } +@media (prefers-color-scheme: dark) { + nav.toc-sidebar a:hover { + /* hover should win over scroll selectors despite beeing less specific */ + background-color: #606060 !important; + } + nav.toc-sidebar a.active { + background-color: #373737; + border-left-color: #eee; + font-weight: 600; + } + nav.toc-sidebar a.active-trail { + border-left-color: #eee; + background-color: #323232; + } +} + @media screen and (min-width: 768px) { body { height: 100vh;