Skip to content

Commit c61df46

Browse files
authored
Add version warning banner for old versions of the docs (#531)
# References and relevant issues Closes #82 # Description We now get the version warning banner for free so we can turn it on :) It looks like this currently: ![Captura de imagem_20241205_171236](https://github.com/user-attachments/assets/fceca5d6-5ef9-4e32-9bff-e3bb646141a9) I'm happy to do some CSS styling if we are not happy with how it looks!
1 parent 3c12f03 commit c61df46

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

Diff for: docs/_static/custom.css

+19
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,23 @@ div.sphx-glr-download a:hover {
2828
.bd-content .sd-tab-set>label {
2929
background-color: var(--napari-gray);
3030
color: #222832;
31+
}
32+
33+
/* Version warning banner color */
34+
#bd-header-version-warning {
35+
background-color: color-mix(in srgb, var(--pst-color-secondary-bg), transparent 30%);
36+
}
37+
38+
#bd-header-version-warning .pst-button-link-to-stable-version {
39+
background-color: color-mix(in srgb, var(--pst-color-secondary-bg), transparent 0%);
40+
border-color: var(--pst-color-secondary-bg);
41+
color: #222832;
42+
font-weight: 700;
43+
}
44+
45+
#bd-header-version-warning .pst-button-link-to-stable-version:hover {
46+
background-color: var(--pst-color-secondary-bg);
47+
border-color: var(--pst-color-secondary-bg);
48+
color: #222832;
49+
font-weight: 700;
3150
}

Diff for: docs/conf.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
"secondary_sidebar_items": ["page-toc"],
119119
"pygment_light_style": "napari",
120120
"pygment_dark_style": "napari",
121-
"announcement": "https://napari.org/dev/_static/announcement.html",
121+
"announcement": "",
122122
"back_to_top_button": False,
123123
"analytics": {
124124
# The domain you'd like to use for this analytics instance
@@ -128,6 +128,7 @@
128128
},
129129
"footer_start": ["napari-footer-links"],
130130
"footer_end": ["napari-copyright"],
131+
"show_version_warning_banner": True,
131132
}
132133

133134
html_sidebars = {

0 commit comments

Comments
 (0)