Make mobile menu fill full viewport height#110
Merged
Conversation
On small screens the open menu now spans 100dvh and its items grow to share that space evenly via flex, so the menu always fills the screen with no oversized padding, overflow, or leftover gaps regardless of the number of items.
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.
Summary
The mobile navigation menu now always uses the full viewport height when open, instead of relying on large fixed padding per item.
Problem
padding: 2.4emtop and bottom. With the current 7 items this made the open menu taller than a typical phone screen, causing overflow.Change (
sass/_base.scss, mobile@media (max-width: 950px)block)100dvh(#menu-toggle:checked ~ .menu), usingdvhso it accounts for mobile browser chrome.flex: 1 1 0so they grow to share the available height evenly. This means the menu always fills the screen exactly with no leftover gaps, regardless of how many items there are.height: 100%) instead of using fixed2.4empadding.Result