Skip to content

Commit 03797c0

Browse files
committed
Fix version selector
1 parent 5d3bba9 commit 03797c0

File tree

3 files changed

+119
-34
lines changed

3 files changed

+119
-34
lines changed

docs/contributing.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ Thank you for your interest in contributing to Vector Inference! This guide will
3131
If you prefer using virtual environments, you can use `uv venv` to create one:
3232
```bash
3333
uv venv
34-
source .venv/bin/activate # On Linux/macOS
35-
# or
36-
.venv\Scripts\activate # On Windows
34+
source .venv/bin/activate
3735
```
3836

3937
## Development Workflow

docs/stylesheets/extra.css

Lines changed: 111 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -90,65 +90,146 @@
9090
margin-right: 0.2em;
9191
}
9292

93-
/* Mike version selector styling */
94-
.md-header__topic {
95-
display: flex;
96-
align-items: center;
97-
}
93+
/* Version selector styling - Material theme */
9894

99-
.md-version-select {
100-
margin-left: 0.6rem;
95+
/* Version selector container */
96+
.md-version {
97+
position: relative;
98+
display: inline-block;
99+
margin-left: 0.25rem;
101100
}
102101

102+
/* Current version button styling */
103103
.md-version__current {
104-
cursor: pointer;
105-
color: var(--md-primary-bg-color);
106-
font-weight: 700;
107-
font-size: 0.8rem;
108-
border: 1px solid rgba(255, 255, 255, 0.3);
109-
border-radius: 4px;
110-
padding: 0.2rem 0.4rem;
111104
display: inline-flex;
112105
align-items: center;
106+
font-size: 0.7rem;
107+
font-weight: 600;
108+
color: var(--md-primary-bg-color);
109+
padding: 0.4rem 0.8rem;
110+
margin: 0.4rem 0;
111+
background-color: rgba(255, 255, 255, 0.1);
112+
border-radius: 4px;
113+
border: 1px solid rgba(255, 255, 255, 0.2);
114+
cursor: pointer;
115+
transition: all 0.15s ease-in-out;
116+
}
117+
118+
/* Hover effect for current version button */
119+
.md-version__current:hover {
120+
background-color: rgba(255, 255, 255, 0.2);
121+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
113122
}
114123

115-
.md-version__current::after {
124+
/* Down arrow for version dropdown */
125+
.md-version__current:after {
116126
display: inline-block;
127+
margin-left: 0.5rem;
117128
content: "";
118-
width: 0;
119-
height: 0;
120-
border-left: 4px solid transparent;
121-
border-right: 4px solid transparent;
122-
border-top: 4px solid currentColor;
123-
margin-left: 0.4rem;
129+
vertical-align: middle;
130+
border-top: 0.3em solid;
131+
border-right: 0.3em solid transparent;
132+
border-bottom: 0;
133+
border-left: 0.3em solid transparent;
124134
}
125135

136+
/* Dropdown menu */
126137
.md-version__list {
127138
position: absolute;
128139
top: 100%;
129140
left: 0;
141+
z-index: 10;
142+
min-width: 125%;
143+
margin: 0.1rem 0 0;
144+
padding: 0;
130145
background-color: var(--md-primary-fg-color);
131146
border-radius: 4px;
132-
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
133-
z-index: 2;
134-
min-width: 150px;
135-
max-height: 0;
136-
overflow: hidden;
137-
transition: max-height 0.25s;
147+
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
148+
opacity: 0;
149+
visibility: hidden;
150+
transform: translateY(-8px);
151+
transition: all 0.2s ease;
138152
}
139153

154+
/* Show dropdown when parent is hovered */
140155
.md-version:hover .md-version__list {
141-
max-height: 300px;
156+
opacity: 1;
157+
visibility: visible;
158+
transform: translateY(0);
159+
}
160+
161+
/* Version list items */
162+
.md-version__item {
163+
list-style: none;
164+
padding: 0;
142165
}
143166

167+
/* Version links */
144168
.md-version__link {
145169
display: block;
146170
padding: 0.5rem 1rem;
171+
font-size: 0.75rem;
147172
color: var(--md-primary-bg-color);
148-
font-size: 0.8rem;
149-
transition: background-color 0.25s;
173+
transition: background-color 0.15s;
174+
text-decoration: none;
150175
}
151176

177+
/* Version link hover */
152178
.md-version__link:hover {
153179
background-color: var(--md-primary-fg-color--dark);
180+
text-decoration: none;
181+
}
182+
183+
/* Active version in dropdown */
184+
.md-version__link--active {
185+
background-color: var(--md-accent-fg-color);
186+
color: var(--md-accent-bg-color);
187+
font-weight: 700;
188+
}
189+
190+
/* For the Material selector */
191+
.md-header__option {
192+
display: flex;
193+
align-items: center;
194+
}
195+
196+
/* Version selector in Material 9.x */
197+
.md-select {
198+
position: relative;
199+
margin-left: 0.5rem;
200+
}
201+
202+
.md-select__label {
203+
font-size: 0.7rem;
204+
font-weight: 600;
205+
color: var(--md-primary-bg-color);
206+
cursor: pointer;
207+
padding: 0.4rem 0.8rem;
208+
background-color: rgba(255, 255, 255, 0.1);
209+
border-radius: 4px;
210+
border: 1px solid rgba(255, 255, 255, 0.2);
211+
transition: all 0.15s ease-in-out;
212+
}
213+
214+
.md-select__label:hover {
215+
background-color: rgba(255, 255, 255, 0.2);
216+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
217+
}
218+
219+
/* Version selector in Material 9.2+ */
220+
.md-header__button.md-select {
221+
display: inline-flex;
222+
align-items: center;
223+
margin: 0 0.8rem;
224+
}
225+
226+
/* For Material 9.x+ with specific version selector */
227+
.md-typeset .md-version-warn {
228+
padding: 0.6rem 1rem;
229+
margin: 1.5rem 0;
230+
background-color: rgba(235, 8, 138, 0.1);
231+
border-left: 4px solid #eb088a;
232+
border-radius: 0.2rem;
233+
color: var(--md-default-fg-color);
234+
font-size: 0.8rem;
154235
}

mkdocs.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ extra:
77
link: 404.html
88
- icon: fontawesome/brands/github
99
link: https://github.com/VectorInstitute/vector-inference
10+
version:
11+
provider: mike
12+
default: latest
1013
markdown_extensions:
1114
- attr_list
1215
- admonition
@@ -38,6 +41,7 @@ plugins:
3841
css_dir: stylesheets
3942
canonical_version: latest
4043
alias_type: symlink
44+
deploy_prefix: ''
4145
- mkdocstrings:
4246
default_handler: python
4347
handlers:
@@ -57,7 +61,9 @@ plugins:
5761
repo_url: https://github.com/VectorInstitute/vector-inference
5862
repo_name: VectorInstitute/vector-inference
5963
site_name: Vector Inference
64+
site_url: https://vectorinstitute.github.io/vector-inference/
6065
theme:
66+
name: material
6167
custom_dir: docs/overrides
6268
favicon: assets/favicon-48x48.svg
6369
features:
@@ -67,6 +73,7 @@ theme:
6773
- navigation.indexes
6874
- navigation.instant
6975
- navigation.tabs
76+
- navigation.tabs.sticky
7077
- navigation.top
7178
- search.suggest
7279
- search.highlight
@@ -75,7 +82,6 @@ theme:
7582
repo: fontawesome/brands/github
7683
logo: assets/vector-logo.svg
7784
logo_footer: assets/vector-logo.svg
78-
name: material
7985
palette:
8086
- media: "(prefers-color-scheme: light)"
8187
scheme: default

0 commit comments

Comments
 (0)