From bea02fafb7b829fab64ac46fa701218089df096d Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:58:53 +0000 Subject: [PATCH 1/7] pin sphinx-hoverxref version to 1.4.x, where x>2 For reference: https://stackoverflow.com/questions/39590187/in-requirements-txt-what-does-tilde-equals-mean --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8464b7ce23..47d05f55a3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ doc = [ 'sphinx-toggleprompt == 0.5.2', 'sphinx-favicon', 'solarfactors', - 'sphinx-hoverxref', + 'sphinx-hoverxref ~= 1.4.2', ] test = [ 'pytest', From 12a2ade5c8e52c4ae9cc8546eb8b98768091393a Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 3 Jan 2025 22:59:11 +0000 Subject: [PATCH 2/7] Create hoverxref-darkmode.css --- docs/sphinx/source/_static/hoverxref-darkmode.css | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docs/sphinx/source/_static/hoverxref-darkmode.css diff --git a/docs/sphinx/source/_static/hoverxref-darkmode.css b/docs/sphinx/source/_static/hoverxref-darkmode.css new file mode 100644 index 0000000000..7f93fbd80f --- /dev/null +++ b/docs/sphinx/source/_static/hoverxref-darkmode.css @@ -0,0 +1,13 @@ +/* Overrides for sphinx-hoverxref since it does not support a native dark theme, see */ +/* https://github.com/readthedocs/sphinx-hoverxref/issues/231 */ +/* Inspired by https://github.com/pybamm-team/PyBaMM/pull/3083 */ + +/* These will ensure that the tooltip inherits the sphinx-pydata-theme colours */ + +.tooltipster-sidetip.tooltipster-shadow .tooltipster-box { + background: var(--pst-color-background) !important; +} + +.tooltipster-sidetip.tooltipster-shadow .tooltipster-content { + color: var(--pst-color-text-base) !important; +} From 7d5b06088a90369069c938f29615f988999ed24d Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 3 Jan 2025 23:20:47 +0000 Subject: [PATCH 3/7] oopsy hoopsy typo --- docs/sphinx/source/_static/hoverxref-darkmode.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sphinx/source/_static/hoverxref-darkmode.css b/docs/sphinx/source/_static/hoverxref-darkmode.css index 7f93fbd80f..5f1e35f144 100644 --- a/docs/sphinx/source/_static/hoverxref-darkmode.css +++ b/docs/sphinx/source/_static/hoverxref-darkmode.css @@ -2,7 +2,7 @@ /* https://github.com/readthedocs/sphinx-hoverxref/issues/231 */ /* Inspired by https://github.com/pybamm-team/PyBaMM/pull/3083 */ -/* These will ensure that the tooltip inherits the sphinx-pydata-theme colours */ +/* These will ensure that the tooltip inherits the pydata-sphinx-theme colours */ .tooltipster-sidetip.tooltipster-shadow .tooltipster-box { background: var(--pst-color-background) !important; From 1553f902df511337529932b1a027099e4aa54847 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:30:17 +0000 Subject: [PATCH 4/7] =?UTF-8?q?hmmmm=20when=20did=20this=20break=3F=20?= =?UTF-8?q?=F0=9F=91=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/sphinx/source/_static/hoverxref-darkmode.css | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/source/_static/hoverxref-darkmode.css b/docs/sphinx/source/_static/hoverxref-darkmode.css index 5f1e35f144..5804459549 100644 --- a/docs/sphinx/source/_static/hoverxref-darkmode.css +++ b/docs/sphinx/source/_static/hoverxref-darkmode.css @@ -4,10 +4,7 @@ /* These will ensure that the tooltip inherits the pydata-sphinx-theme colours */ -.tooltipster-sidetip.tooltipster-shadow .tooltipster-box { - background: var(--pst-color-background) !important; -} - -.tooltipster-sidetip.tooltipster-shadow .tooltipster-content { +.tooltipster-sidetip.tooltipster-shadow.tooltipster-shadow-custom .tooltipster-content { + background-color: var(--pst-color-background) !important; color: var(--pst-color-text-base) !important; } From 10aa08bb001ca1fcc0ee6fc5116f38f1ced61d14 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 21 Feb 2025 20:40:33 +0000 Subject: [PATCH 5/7] =?UTF-8?q?Imma=20stupid=20for=20this,=20sorry=20Kevin?= =?UTF-8?q?=20=F0=9F=99=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...overxref-darkmode.css => tooltips_matching_color_scheme.css} | 0 docs/sphinx/source/conf.py | 2 ++ 2 files changed, 2 insertions(+) rename docs/sphinx/source/_static/{hoverxref-darkmode.css => tooltips_matching_color_scheme.css} (100%) diff --git a/docs/sphinx/source/_static/hoverxref-darkmode.css b/docs/sphinx/source/_static/tooltips_matching_color_scheme.css similarity index 100% rename from docs/sphinx/source/_static/hoverxref-darkmode.css rename to docs/sphinx/source/_static/tooltips_matching_color_scheme.css diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index a08507c0b3..309ed8ea48 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -282,6 +282,8 @@ def setup(app): app.add_css_file("reference_format.css") # Add a warning banner at the top of the page if viewing the "latest" docs app.add_js_file("version-alert.js") + # Match the color scheme of the hover tooltips to PyData Sphinx Theme + app.add_css_file("tooltips_matching_color_scheme.css") # -- Options for LaTeX output --------------------------------------------- From 57569cd1a78dea2c7ccc17a486e9790d3a3fc1e3 Mon Sep 17 00:00:00 2001 From: echedey-ls <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 21 Feb 2025 22:22:01 +0000 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=9A=80=20i=20did=20it?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...atching_color_scheme.css => tooltipster_color_theming.css} | 0 docs/sphinx/source/conf.py | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename docs/sphinx/source/_static/{tooltips_matching_color_scheme.css => tooltipster_color_theming.css} (100%) diff --git a/docs/sphinx/source/_static/tooltips_matching_color_scheme.css b/docs/sphinx/source/_static/tooltipster_color_theming.css similarity index 100% rename from docs/sphinx/source/_static/tooltips_matching_color_scheme.css rename to docs/sphinx/source/_static/tooltipster_color_theming.css diff --git a/docs/sphinx/source/conf.py b/docs/sphinx/source/conf.py index 309ed8ea48..5c1a85ddc5 100644 --- a/docs/sphinx/source/conf.py +++ b/docs/sphinx/source/conf.py @@ -282,8 +282,8 @@ def setup(app): app.add_css_file("reference_format.css") # Add a warning banner at the top of the page if viewing the "latest" docs app.add_js_file("version-alert.js") - # Match the color scheme of the hover tooltips to PyData Sphinx Theme - app.add_css_file("tooltips_matching_color_scheme.css") + # Match the color theme of tooltips to PyData Sphinx Theme light/dark mode + app.add_css_file("tooltipster_color_theming.css") # -- Options for LaTeX output --------------------------------------------- From 598420969099e02002c27ff23e5a82854088975d Mon Sep 17 00:00:00 2001 From: Echedey Luis <80125792+echedey-ls@users.noreply.github.com> Date: Fri, 28 Feb 2025 23:16:00 +0000 Subject: [PATCH 7/7] Code review (Kevin) Co-authored-by: Kevin Anderson --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 47d05f55a3..b368cc75df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ doc = [ 'sphinx-toggleprompt == 0.5.2', 'sphinx-favicon', 'solarfactors', - 'sphinx-hoverxref ~= 1.4.2', + 'sphinx-hoverxref ~= 1.4.2', # when updating, check that _static/tooltipster_color_theming.css still works ] test = [ 'pytest',