Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update switcher styling #1400

Merged
merged 4 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
20 changes: 0 additions & 20 deletions docs/_static/custom.css
Original file line number Diff line number Diff line change
@@ -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.
*/
Expand Down
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
12rambau marked this conversation as resolved.
Show resolved Hide resolved
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;
}
}
}
}
Expand Down
Loading