File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 32
32
letter-spacing : -.03em ;
33
33
}
34
34
35
+ /* Style the active version button.
36
+
37
+ - dev: orange
38
+ - stable: green
39
+ - old, PR: red
40
+
41
+ Colors from:
42
+
43
+ Wong, B. Points of view: Color blindness.
44
+ Nat Methods 8, 441 (2011). https://doi.org/10.1038/nmeth.1618
45
+ */
46
+
47
+ /* If the active version has the name "dev", style it orange */
48
+ # version_switcher_button [data-active-version-name *= "dev" ] {
49
+ background-color : # E69F00 ;
50
+ border-color : # E69F00 ;
51
+ }
52
+
53
+ /* green for `stable` */
54
+ # version_switcher_button [data-active-version-name *= "stable" ] {
55
+ background-color : # 009E73 ;
56
+ border-color : # 009E73 ;
57
+ }
58
+
59
+ /* red for `old` */
60
+ # version_switcher_button : not ([data-active-version-name *= "stable" ], [data-active-version-name *= "dev" ], [data-active-version-name = "" ]) {
61
+ background-color : # 980F0F ;
62
+ border-color : # 980F0F ;
63
+ }
64
+
35
65
/* Main page overview cards */
36
66
37
67
.intro-card {
Original file line number Diff line number Diff line change @@ -172,7 +172,11 @@ def setup(app):
172
172
html_favicon = '_static/favicon/favicon.ico'
173
173
174
174
# Set up the version switcher. The versions.json is stored in the devdocs.
175
- if ".dev" in version :
175
+ if os .environ .get ('CIRCLE_JOB' , False ) and \
176
+ os .environ .get ('CIRCLE_BRANCH' , '' ) != 'main' :
177
+ # For PR, name is set to its ref
178
+ switcher_version = os .environ ['CIRCLE_BRANCH' ]
179
+ elif ".dev" in version :
176
180
switcher_version = "devdocs"
177
181
else :
178
182
switcher_version = f"doc/{ version } "
You can’t perform that action at this time.
0 commit comments