Merge pull request #5056 from hugovk/fix-4th-level-menu-dark-mode

Don't add light mode bg to 3rd and 4th level menu items
This commit is contained in:
Andrew Murray 2020-12-22 07:37:48 +11:00 committed by GitHub
commit 0e50e72807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -311,3 +311,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")

View File

@ -1196,6 +1196,11 @@
color: rgb(166, 158, 146);
}
.wy-menu-vertical li.toctree-l2.current a,
.wy-menu-vertical li.toctree-l3.current a {
background-color: #363636;
}
.wy-menu-vertical li ul li a {
color: rgb(208, 204, 198);
}

View File

@ -0,0 +1,8 @@
@media (prefers-color-scheme: light) {
.wy-menu-vertical li.toctree-l2.current a,
.wy-menu-vertical li.toctree-l3.current a {
background-color: #c9c9c9;
}
}

View File

@ -24,13 +24,11 @@ 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) {
$upperA.prepend($('<span />').addClass('toctree-expand'));
}
$a.css('background-color', '#c9c9c9');
$a.css('padding-left', '5em');
} else {
$a.css('background-color', '#bdbdbd');