From 1b7f2fd114e16c4ca7844c9584b8a15fa5d23ba8 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 7 Aug 2023 09:50:45 -0500 Subject: [PATCH 1/4] remove green color for "stable" --- docs/_static/custom.css | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 1b50690c8..06dec25cf 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,23 +1,3 @@ -/* Background of stable should be green */ -.version-switcher__container a[data-version-name*="stable"] { - position: relative; - background-color: var(--pst-color-success-bg); - box-shadow: inset 3px 0px 0px var(--pst-color-success); -} - -.version-switcher__container a[data-version-name*="stable"] span { - color: var(--pst-color-success); -} - -.version-switcher__container a[data-version-name*="stable"] span:before { - content: ""; - width: 100%; - height: 100%; - position: absolute; - left: 0; - top: 0; -} - /* custom CSS classes (used in docs/user_guide/extending.rst) NOTE: the begin * and end markers are necessary for partial file includes! don't remove them. */ From f23fa2d7ea08b8d83d09f070391a14bdce8927b1 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 7 Aug 2023 09:51:20 -0500 Subject: [PATCH 2/4] unify latest/dev naming --- docs/conf.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index e05c8f76b..c0e32ccb4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -100,7 +100,8 @@ version_match = os.environ.get("READTHEDOCS_VERSION") # If READTHEDOCS_VERSION doesn't exist, we're not on RTD # If it is an integer, we're in a PR build and the version isn't correct. -if not version_match or version_match.isdigit(): +# If it's "latest" → change to "dev" (that's what we want the switcher to call it) +if not version_match or version_match.isdigit() or version_match == "latest": # For local development, infer the version to match from the package. release = pydata_sphinx_theme.__version__ if "dev" in release or "rc" in release: From 7210700b5f0699cf33683778343eeb9d7347ef04 Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 7 Aug 2023 09:52:02 -0500 Subject: [PATCH 3/4] add left border to active item (don't rely only on colour) --- .../styles/components/_switcher-version.scss | 31 +++++++++---------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss b/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss index e494f026d..6828ececd 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss @@ -31,23 +31,22 @@ button.btn.version-switcher__button { &:hover { background-color: var(--pst-color-surface); } - } - - // Over-rides Bootstrap default blue for the current one (info-bg) - // TODO: @trallard to fix active in subsequent PR - a.list-group-item.active { - color: var(--pst-color-info); - position: relative; - z-index: 1; + &.active { + color: var(--pst-color-primary); + border-left: 0.2rem solid; + border-left-color: currentcolor; + position: relative; + z-index: 1; - span:before { - content: ""; - width: 100%; - height: 100%; - position: absolute; - z-index: -1; - left: 0; - top: 0; + span:before { + content: ""; + width: 100%; + height: 100%; + position: absolute; + z-index: -1; + left: 0; + top: 0; + } } } } From 0501bbdeeb310ac1a651d4feff552572b86ba4ca Mon Sep 17 00:00:00 2001 From: Daniel McCloy Date: Mon, 7 Aug 2023 12:11:11 -0500 Subject: [PATCH 4/4] use mixin --- .../assets/styles/components/_switcher-version.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss b/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss index 6828ececd..2d152b952 100644 --- a/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss +++ b/src/pydata_sphinx_theme/assets/styles/components/_switcher-version.scss @@ -32,9 +32,7 @@ button.btn.version-switcher__button { background-color: var(--pst-color-surface); } &.active { - color: var(--pst-color-primary); - border-left: 0.2rem solid; - border-left-color: currentcolor; + @include link-sidebar-current; position: relative; z-index: 1;