diff --git a/doc/_static/mpl.css b/doc/_static/mpl.css index 2d26f8738406..bb7806a58db9 100644 --- a/doc/_static/mpl.css +++ b/doc/_static/mpl.css @@ -277,3 +277,22 @@ div.twocol > div { display: inline-block; margin: 0 0.5em; } + + +/* styling for version switcher */ +.navbar-brand { + /* pydata-sphinx-theme sets this as flex for some reason + but we cannot place the version switcher to its right then. + */ + display: inline-block; +} + +#version_switcher { + display: inline-block; +} + +#version_switcher_button { + color: rgba(var(--pst-color-text-base),1); + background-color: rgba(0,0,0,.03); + border: 1px solid rgba(0,0,0,.125); +} diff --git a/doc/conf.py b/doc/conf.py index 4b8609e5ec01..6bc0d4351e2b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -339,9 +339,14 @@ def matplotlib_reduced_latex_scraper(block, block_vars, gallery_conf, "switcher": { "json_url": "https://matplotlib.org/devdocs/_static/switcher.json", "url_template": "https://matplotlib.org/{version}/", - "version_match": version, + "version_match": ( + # The start version to show. This must be in switcher.json. + # We either go to 'stable' or to 'devdocs' + 'stable' if matplotlib.__version_info__.releaselevel == 'final' + else 'devdocs') }, - "navbar_end": ["version-switcher", "mpl_icon_links"] + "navbar_start": ["mpl_navbar_logo", "version-switcher"], + "navbar_end": ["mpl_icon_links"] } include_analytics = is_release_build if include_analytics: