|
219 | 219 | } |
220 | 220 |
|
221 | 221 | /* ========================================================================== |
222 | | - Responsive Styles - Mobile (Collapsed Menu) |
223 | | - |
224 | | - Bootstrap 3 navbar collapses at 768px by default, but experimentally |
225 | | - this occurs at 789px for this navbar configuration. |
226 | | - |
| 222 | + Responsive Styles - Mobile / Tablet (Collapsed Menu) |
| 223 | +
|
| 224 | + The collapsed (hamburger) menu is used up to 991px. The brand + 8 menu items |
| 225 | + don't fit on one horizontal line until ~970px, so collapsing at Bootstrap's |
| 226 | + default 768px left the menu wrapping onto a second line between ~768–991px |
| 227 | + (issue #1286). The breakpoint override further below re-asserts the collapsed |
| 228 | + layout across 768–991px; these rules style that collapsed menu. |
| 229 | +
|
227 | 230 | Key mobile improvements: |
228 | 231 | - Minimum 44px touch targets (Apple HIG guideline) |
229 | 232 | - Larger font size for readability |
230 | 233 | - Icons visible for quick recognition |
231 | 234 | - Clear visual separation between items |
232 | 235 | ========================================================================== */ |
233 | 236 |
|
234 | | -@media only screen and (max-width: 789px) { |
| 237 | +@media only screen and (max-width: 991px) { |
| 238 | + /* |
| 239 | + * Taller navbar on mobile. The default 40px height left the hamburger button |
| 240 | + * small and hard to tap, and felt disproportionately short next to the |
| 241 | + * enlarged collapsed menu items. See issue #1282. |
| 242 | + */ |
| 243 | + .navbar-custom { |
| 244 | + height: 56px; |
| 245 | + padding-top: 0; |
| 246 | + } |
| 247 | + |
| 248 | + /* Vertically center the brand (logo + text) within the taller navbar. The |
| 249 | + float (set by Bootstrap) still positions it on the left. */ |
| 250 | + .navbar-custom .navbar-brand { |
| 251 | + display: flex; |
| 252 | + align-items: center; |
| 253 | + height: 56px; |
| 254 | + } |
| 255 | + |
| 256 | + /* Scale the logo mark up to suit the taller navbar (the 20px default looked |
| 257 | + undersized and top-light in a 56px bar). Width stays auto to keep ratio. */ |
| 258 | + .navbar-custom .navbar-brand > img { |
| 259 | + height: 32px; |
| 260 | + } |
| 261 | + |
| 262 | + /* Logo-only brand on mobile. The wordmark looked tiny and cramped next to the |
| 263 | + enlarged logo, so we hide it here. The brand link keeps an accessible name |
| 264 | + via the aria-label on the <a> in base.html. See issue #1282 discussion. */ |
| 265 | + .navbar-custom .makeabilitylab-text { |
| 266 | + display: none; |
| 267 | + } |
| 268 | + |
| 269 | + /* Larger hamburger button: ≥44px touch target (Apple HIG) with a bigger icon, |
| 270 | + vertically centered within the navbar. Float keeps it on the right. */ |
| 271 | + .navbar-custom .navbar-toggle { |
| 272 | + display: flex; |
| 273 | + align-items: center; |
| 274 | + justify-content: center; |
| 275 | + height: 56px; |
| 276 | + min-width: 48px; |
| 277 | + padding: 0 14px; |
| 278 | + margin: 0; |
| 279 | + } |
| 280 | + |
| 281 | + .navbar-custom .navbar-toggle .fa-bars { |
| 282 | + font-size: 26px; |
| 283 | + } |
| 284 | + |
235 | 285 | /* Collapsed menu background */ |
236 | 286 | .navbar-collapse ul { |
237 | 287 | background-color: var(--navbar-bg-color); |
238 | 288 | } |
239 | 289 |
|
| 290 | + /* Make the dropdown sit flush against the navbar. Bootstrap's default 7.5px |
| 291 | + top margin on .navbar-nav left a gap where the page showed through between |
| 292 | + the navbar and the menu panel. See issue #1282 discussion. */ |
| 293 | + .navbar-custom .navbar-nav { |
| 294 | + margin-top: 0; |
| 295 | + margin-bottom: 0; |
| 296 | + } |
| 297 | + |
240 | 298 | /* |
241 | 299 | * Mobile navigation links |
242 | 300 | * Touch target sizing follows Apple HIG (44pt minimum) and |
|
257 | 315 | font-size: 18px; |
258 | 316 | } |
259 | 317 |
|
| 318 | + /* Stack menu items vertically. Bootstrap floats them left ≥768px; the |
| 319 | + breakpoint override below keeps the menu collapsed up to 991px, so the |
| 320 | + items must not float there. (No-op below 768px.) */ |
| 321 | + .navbar-custom .navbar-nav > li { |
| 322 | + float: none; |
| 323 | + } |
| 324 | + |
260 | 325 | /* Add subtle separator between menu items */ |
261 | 326 | .navbar-custom .navbar-nav > li { |
262 | 327 | border-bottom: 1px solid rgba(255, 255, 255, 0.1); |
|
286 | 351 | } |
287 | 352 | } |
288 | 353 |
|
| 354 | +/* ========================================================================== |
| 355 | + Raise the navbar collapse breakpoint to 992px |
| 356 | +
|
| 357 | + Bootstrap 3.3.6 switches the navbar to its horizontal layout at 768px, but |
| 358 | + the brand + 8 menu items don't fit on one line until ~970px — so between |
| 359 | + 768–991px the menu wrapped onto a second line (issue #1286). These rules |
| 360 | + re-assert Bootstrap's collapsed (hamburger) layout across 768–991px, so the |
| 361 | + horizontal menu only appears once it actually fits (≥992px). The collapsed |
| 362 | + styling itself comes from the max-width: 991px block above. |
| 363 | + ========================================================================== */ |
| 364 | + |
| 365 | +@media (min-width: 768px) and (max-width: 991px) { |
| 366 | + /* Don't float the header into a horizontal row */ |
| 367 | + .navbar-custom .navbar-header { |
| 368 | + float: none; |
| 369 | + } |
| 370 | + |
| 371 | + /* Keep the dropdown hidden until toggled (Bootstrap forces it open ≥768px) */ |
| 372 | + .navbar-custom .navbar-collapse.collapse { |
| 373 | + display: none !important; |
| 374 | + } |
| 375 | + |
| 376 | + .navbar-custom .navbar-collapse.collapse.in { |
| 377 | + display: block !important; |
| 378 | + overflow-y: auto !important; |
| 379 | + } |
| 380 | +} |
| 381 | + |
289 | 382 | /* ========================================================================== |
290 | 383 | Light Theme Mobile Adjustments |
291 | 384 | ========================================================================== */ |
292 | 385 |
|
293 | | -@media only screen and (max-width: 789px) { |
| 386 | +@media only screen and (max-width: 991px) { |
294 | 387 | .light-navbar-theme .navbar-nav > li { |
295 | 388 | border-bottom-color: rgba(0, 0, 0, 0.1); |
296 | 389 | } |
|
0 commit comments