diff --git a/yardang/build.py b/yardang/build.py index 333b2e6..d2b2ea8 100644 --- a/yardang/build.py +++ b/yardang/build.py @@ -70,8 +70,8 @@ def generate_docs_configuration( pages = pages or get_config(section="pages", base=config_base) or [] use_autoapi = use_autoapi or get_config(section="use-autoapi", base=config_base) - custom_css = custom_css or get_config(section="custom-css", base=config_base) or (Path(__file__).parent / "custom.css") - custom_js = custom_js or get_config(section="custom-js", base=config_base) or (Path(__file__).parent / "custom.js") + custom_css = custom_css or Path(get_config(section="custom-css", base=config_base) or (Path(__file__).parent / "custom.css")) + custom_js = custom_js or Path(get_config(section="custom-js", base=config_base) or (Path(__file__).parent / "custom.js")) source_dir = os.path.curdir diff --git a/yardang/custom.css b/yardang/custom.css index dcf83cb..87e9476 100644 --- a/yardang/custom.css +++ b/yardang/custom.css @@ -9,4 +9,38 @@ aside.sidebar-drawer { /* Left-align tables */ article table.align-default { margin-left: 0; -} \ No newline at end of file +} + +/* Handle logo switching for light/dark themes */ +/* Put in code like: + + nbprint + + + nbprint + +*/ +body[data-theme="light"] .logo-light { + display: inline; +} +body[data-theme="light"] .logo-dark { + display: none; +} +body[data-theme="dark"] .logo-light { + display: none; +} +body[data-theme="dark"] .logo-dark { + display: inline; +} + +@media (prefers-color-scheme: dark) { + .logo-light { + display: none; + } +} + +@media (prefers-color-scheme: light) { + .logo-dark { + display: none; + } +}