Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions yardang/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
36 changes: 35 additions & 1 deletion yardang/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,38 @@ aside.sidebar-drawer {
/* Left-align tables */
article table.align-default {
margin-left: 0;
}
}

/* Handle logo switching for light/dark themes */
/* Put in code like:
<a class="logo-light" href="https://github.com/nbprint/nbprint#gh-light-mode-only">
<img src="https://github.com/nbprint/nbprint/raw/main/docs/img/logo-light.png?raw=true#gh-light-mode-only" alt="nbprint" width="400"></a>
</a>
<a class="logo-dark" href="https://github.com/nbprint/nbprint#gh-dark-mode-only">
<img src="https://github.com/nbprint/nbprint/raw/main/docs/img/logo-dark.png?raw=true#gh-dark-mode-only" alt="nbprint" width="400"></a>
</a>
*/
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;
}
}