Skip to content

Commit 911aafa

Browse files
author
TechStack Global
committed
fix: mobile toggle broken by competing CSS media query and missing pointer-events
Root cause 1: @media (max-width: 768px) block at ~line 1094 set .glass-header nav { flex-direction: column } and .nav-links { display: flex } unconditionally, overriding the correct mobile nav overlay block and causing the nav menu to remain always-visible (ignoring toggle state). Root cause 2: Hidden .nav-links had no pointer-events: none, so the invisible off-screen nav could intercept taps, blocking click events on the toggle button. Fix: Remove conflicting nav rules from early media query block. Add pointer-events: none to closed state and pointer-events: auto to .active state. Only style.css modified. JS unchanged. HTML unchanged.
1 parent fdbba9c commit 911aafa

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

style.css

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,19 +1091,9 @@ img {
10911091
}
10921092

10931093
/* Responsive adjustments */
1094+
/* NOTE: Mobile nav layout (menu-toggle, nav-links) is handled exclusively
1095+
in the "Mobile Navigation Overlay" block below to avoid conflicts. */
10941096
@media (max-width: 768px) {
1095-
.glass-header nav {
1096-
flex-direction: column;
1097-
gap: 1rem;
1098-
}
1099-
1100-
.nav-links {
1101-
display: flex;
1102-
flex-wrap: wrap;
1103-
justify-content: center;
1104-
gap: 1rem;
1105-
}
1106-
11071097
.hero {
11081098
flex-direction: column;
11091099
text-align: center;
@@ -1274,6 +1264,8 @@ img {
12741264
/* Tight vertical spacing as requested (12-16px) */
12751265
transform: translateY(-100%);
12761266
opacity: 0;
1267+
pointer-events: none;
1268+
/* BUGFIX: prevent invisible menu from blocking taps on toggle */
12771269
transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
12781270
z-index: 999;
12791271
border-left: none;
@@ -1284,6 +1276,8 @@ img {
12841276
.nav-links.active {
12851277
transform: translateY(0);
12861278
opacity: 1;
1279+
pointer-events: auto;
1280+
/* BUGFIX: restore interactivity when menu is open */
12871281
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
12881282
}
12891283

0 commit comments

Comments
 (0)