Skip to content

Commit 2a7b99b

Browse files
committed
work on light theme for docs
1 parent be2f9f9 commit 2a7b99b

2 files changed

Lines changed: 8 additions & 21 deletions

File tree

docs/source/_static/custom.css

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
/* ------------------------------------------------------------------ */
2-
/* Force light colour scheme regardless of OS/browser preference. */
3-
/* */
4-
/* pydata-sphinx-theme respects color_mode:'light' in conf.py by */
5-
/* setting data-theme="light" on <html>, but still ships a */
6-
/* prefers-color-scheme:dark media block. The rules below override */
7-
/* that block so the docs always render in light mode. */
8-
/* ------------------------------------------------------------------ */
9-
10-
/* Prevent native browser controls (inputs, scrollbars, etc.) */
11-
/* from switching to dark variants. */
1+
/* Keep native browser controls (scrollbars, form widgets) in their light
2+
variants — pydata's default_mode="light" handles the rest. */
123
:root {
13-
color-scheme: light !important;
14-
}
15-
16-
/* Re-assert light variables if the theme's dark media query fires. */
17-
@media (prefers-color-scheme: dark) {
18-
html[data-theme="light"],
19-
html:not([data-theme="dark"]) {
20-
color-scheme: light;
21-
}
4+
color-scheme: light;
225
}
236

247
/* ------------------------------------------------------------------ */

docs/source/conf.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ def setup(app):
6464

6565
html_theme = 'pydata_sphinx_theme'
6666

67+
# Force light mode regardless of the visitor's OS preference. pydata-sphinx-theme
68+
# sets data-theme="light" on <html> when default_mode == "light", and the navbar
69+
# theme-switcher is excluded via navbar_end so visitors can't toggle to dark.
70+
html_context = {'default_mode': 'light'}
71+
6772
html_theme_options = {
6873
'logo': {'text': 'fvGP'},
6974
'github_url': 'https://github.com/lbl-camera/fvgp',
@@ -73,7 +78,6 @@ def setup(app):
7378
'secondary_sidebar_items': ['page-toc'],
7479
'footer_start': ['copyright'],
7580
'footer_end': [],
76-
'color_mode': 'light',
7781
}
7882

7983
html_static_path = ['_static']

0 commit comments

Comments
 (0)