Skip to content

Commit 4e31a35

Browse files
appleboyclaude
andcommitted
fix(css): resolve mobile navbar jumping from specificity and transition conflicts
- Replace transition: all with explicit transform, opacity, visibility to avoid layout jitter - Hide hover-bridge pseudo-element on mobile where position: static makes it unnecessary - Raise aria-expanded selector specificity to always win over hover-disable rule on mobile Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0b6eed6 commit 4e31a35

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

  • internal/templates/static/css/components

internal/templates/static/css/components/navbar.css

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@
206206
transform: translateY(-100%);
207207
opacity: 0;
208208
visibility: hidden;
209-
transition: all var(--transition-base);
209+
transition: transform var(--transition-base),
210+
opacity var(--transition-base),
211+
visibility var(--transition-base);
210212
}
211213

212214
.navbar-menu.active {
@@ -461,6 +463,11 @@
461463
width: 100%;
462464
}
463465

466+
/* Hide the hover-bridge pseudo-element on mobile (no function when position: static) */
467+
.navbar-dropdown-menu::before {
468+
display: none;
469+
}
470+
464471
.navbar-dropdown-menu {
465472
position: static;
466473
box-shadow: none;
@@ -482,13 +489,6 @@
482489
max-height var(--transition-base);
483490
}
484491

485-
.navbar-dropdown-trigger[aria-expanded="true"] + .navbar-dropdown-menu {
486-
opacity: 1;
487-
visibility: visible;
488-
max-height: 300px;
489-
pointer-events: auto;
490-
}
491-
492492
/* Disable hover-open on mobile */
493493
.navbar-dropdown:hover .navbar-dropdown-menu {
494494
opacity: 0;
@@ -498,6 +498,14 @@
498498
pointer-events: none;
499499
}
500500

501+
/* JS-driven open state must always win on mobile (specificity 0-4-0 beats hover's 0-3-0) */
502+
.navbar-dropdown .navbar-dropdown-trigger[aria-expanded="true"] + .navbar-dropdown-menu {
503+
opacity: 1;
504+
visibility: visible;
505+
max-height: 300px;
506+
pointer-events: auto;
507+
}
508+
501509
.navbar-dropdown-item {
502510
padding: var(--space-2) var(--space-4);
503511
border-radius: 0;

0 commit comments

Comments
 (0)