fix: prevent white overlay when mobile burger menu opens#15
Closed
vahldiek wants to merge 1 commit into
Closed
Conversation
The Minimal Mistakes theme's greedy-nav JS adds a .close class to the hamburger toggle button, which triggers a full-screen white ::before overlay (opacity 0.9, background #fff). Since we use Alpine.js for the hamburger menu instead of the theme's built-in mechanism, this overlay blocks the entire page on mobile in both light and dark mode. Fixes: 1. Add inline <style> in head/custom.html that sets display:none and content:none on .greedy-nav__toggle::before (guaranteed to load before the theme's CSS takes effect) 2. Prevent the .close class from hiding the navicon (hamburger icon) 3. Unbind jQuery's click handler on window load so the theme's JS cannot interfere with Alpine's menu toggling
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On mobile, tapping the burger menu icon causes a full-screen white overlay to appear, making the page appear blank. This occurs in both light and dark mode.
Root Cause
The Minimal Mistakes theme's greedy-nav jQuery plugin adds a
.closeclass to.greedy-nav__togglewhen clicked, which triggers a::beforepseudo-element styled as a full-screen white backdrop (opacity: 0.9,background-color: #fff,position: fixed,width/height: 100%).Since we use Alpine.js for the hamburger menu instead of the theme's built-in
.hidden-linksmechanism, this overlay serves no purpose and simply blocks the entire page.Fix
.closeclass from making the hamburger icon invisiblewindow.loadso it cannot toggle the.closeclass or interfere with Alpine's menuTesting