From effb351d09daf2bd4327ddccfd1943433db3f3ca Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 24 Nov 2020 12:25:40 +0200 Subject: [PATCH 1/3] Don't add light mode bg to 4th level menu items [CI skip] --- docs/resources/js/script.js | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/resources/js/script.js b/docs/resources/js/script.js index 3bc216c2d..d58571d6d 100644 --- a/docs/resources/js/script.js +++ b/docs/resources/js/script.js @@ -30,7 +30,6 @@ jQuery(document).ready(function ($) { if (!$upperA.find('.toctree-expand').length) { $upperA.prepend($('').addClass('toctree-expand')); } - $a.css('background-color', '#c9c9c9'); $a.css('padding-left', '5em'); } else { $a.css('background-color', '#bdbdbd'); From dea2eb54affa99f213eb9cafff4fefbcb2a5e5ca Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Tue, 24 Nov 2020 13:10:01 +0200 Subject: [PATCH 2/3] Set background-color depending on dark/light mode --- docs/conf.py | 1 + docs/resources/css/dark.css | 4 ++++ docs/resources/css/light.css | 7 +++++++ 3 files changed, 12 insertions(+) create mode 100644 docs/resources/css/light.css diff --git a/docs/conf.py b/docs/conf.py index a8f101141..bd17da0e6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -310,3 +310,4 @@ texinfo_documents = [ def setup(app): app.add_js_file("js/script.js") app.add_css_file("css/dark.css") + app.add_css_file("css/light.css") diff --git a/docs/resources/css/dark.css b/docs/resources/css/dark.css index c746e76cf..2ed958429 100644 --- a/docs/resources/css/dark.css +++ b/docs/resources/css/dark.css @@ -1196,6 +1196,10 @@ color: rgb(166, 158, 146); } + .wy-menu-vertical li.toctree-l3.current a { + background-color: #363636; + } + .wy-menu-vertical li ul li a { color: rgb(208, 204, 198); } diff --git a/docs/resources/css/light.css b/docs/resources/css/light.css new file mode 100644 index 000000000..ae3debc91 --- /dev/null +++ b/docs/resources/css/light.css @@ -0,0 +1,7 @@ +@media (prefers-color-scheme: light) { + + .wy-menu-vertical li.toctree-l3.current a { + background-color: #c9c9c9; + } + +} From 0a1dcfc55a0f1f94115a5708c51867268b9636b7 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 21 Dec 2020 09:10:19 +1100 Subject: [PATCH 3/3] Fix 3rd level menu item background-color in dark mode [ci skip] --- docs/resources/css/dark.css | 1 + docs/resources/css/light.css | 1 + docs/resources/js/script.js | 1 - 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/resources/css/dark.css b/docs/resources/css/dark.css index 2ed958429..cc213d674 100644 --- a/docs/resources/css/dark.css +++ b/docs/resources/css/dark.css @@ -1196,6 +1196,7 @@ color: rgb(166, 158, 146); } + .wy-menu-vertical li.toctree-l2.current a, .wy-menu-vertical li.toctree-l3.current a { background-color: #363636; } diff --git a/docs/resources/css/light.css b/docs/resources/css/light.css index ae3debc91..04edd7b16 100644 --- a/docs/resources/css/light.css +++ b/docs/resources/css/light.css @@ -1,5 +1,6 @@ @media (prefers-color-scheme: light) { + .wy-menu-vertical li.toctree-l2.current a, .wy-menu-vertical li.toctree-l3.current a { background-color: #c9c9c9; } diff --git a/docs/resources/js/script.js b/docs/resources/js/script.js index d58571d6d..5cb6494ea 100644 --- a/docs/resources/js/script.js +++ b/docs/resources/js/script.js @@ -24,7 +24,6 @@ jQuery(document).ready(function ($) { var $upperA = $sidebarItem.parent().children('a'); var $upperAParent = $upperA.parent(); if ($upperAParent.hasClass('toctree-l2')) { - $a.css('background-color', '#c9c9c9'); $a.css('padding-left', '4em'); } else if ($upperAParent.hasClass('toctree-l3')) { if (!$upperA.find('.toctree-expand').length) {