From 8d20692c2e2079ddd2a861ac81956ee63d97cb93 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Sun, 27 Oct 2024 18:31:26 -0400 Subject: [PATCH] fix: switch dark theme for banner with sphinx-book-theme (#67) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- deepmodeling_sphinx/banner.css | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/deepmodeling_sphinx/banner.css b/deepmodeling_sphinx/banner.css index d8b8605..e337cd6 100644 --- a/deepmodeling_sphinx/banner.css +++ b/deepmodeling_sphinx/banner.css @@ -560,7 +560,36 @@ under MIT license } @media (prefers-color-scheme: dark) { - /* Dark mode */ + /* skip sphinx-book-theme */ + html:not([data-theme]) { + /* Dark mode */ + .header-holder { + background-color: #1e1e1e; + } + .header-logo::after { + color: #ffffff; + } + .header-holder .main-menu ul li a { + color: #ffffff; + } + .resources-dropdown-menu { + color: #ffffff; + background-color: #1e1e1e; + } + .header-holder .main-menu ul li a.nav-dropdown-item { + color: #ffffff; + } + .header-holder .main-menu ul li a.nav-dropdown-item .dropdown-title { + color: #ffffff; + } + .wy-body-for-nav { + background-color: #1e1e1e; + } + } +} + +html[data-theme="dark"] { + /* sphinx-book-theme Dark mode */ .header-holder { background-color: #1e1e1e; }