Fix mobile close (X) button visibility by correcting active state col…#20
Open
priyanshusky0 wants to merge 1 commit intoc2siorg:mainfrom
Open
Fix mobile close (X) button visibility by correcting active state col…#20priyanshusky0 wants to merge 1 commit intoc2siorg:mainfrom
priyanshusky0 wants to merge 1 commit intoc2siorg:mainfrom
Conversation
Contributor
|
Please attach before/after screenshots if UI/style changes :) |
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.
Closes #18
Summary
The mobile close (X) icon was not visible when the hamburger menu was opened.
Root Cause
The issue had two layers:
1. Color Contrast Conflict
The .hamburger-inner, ::before, and ::after elements were using $primary as their background color even in the active state.
Since the mobile menu overlay also uses $primary, the close (X) icon blended into the background and became invisible.
2. Header Stacking Context / Visual Layering
The header remained visible with a white background (z-index: 1000) when the mobile menu opened.
This prevented the white X from being clearly visible against the blue overlay behind it.
Changes Made
1. Added an .is-active override in _hamburger.scss to render the hamburger bars in white when the menu is open:
&.is-active {
.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after {
background: #fff;
}
}
2. Updated _header.scss so that when body.lock-scroll is active (mobile menu open), the header becomes visually transparent:
.lock-scroll {
.header {
background-color: transparent;
border-bottom-color: transparent;
box-shadow: none;
}
}
This ensures the white close (X) icon is clearly visible against the blue overlay.
Verification
• Tested locally using bundle exec jekyll serve
• Verified in responsive mobile view
• Confirmed:
• Hamburger animates correctly
• White X is visible
• Menu closes correctly
• No desktop regression observed