Repository navigation
Header Sticky: Keep the open navigation overlay above the admin bar and Search Bar - #135
Open
rahultank-spaceo wants to merge 2 commits into
Open
rahultank-spaceo wants to merge 2 commits into
rahultank-spaceo wants to merge 2 commits into
Conversation
…nd Search Bar Fixes WordPress#98, fixes WordPress#99.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
👋 Thanks for your first pull request, @rahultank-spaceo! We'll take a look soon. |
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.
Description
Fixes #98, fixes #99.
With the Header Sticky design, the header wrapper is
position: sticky; z-index: 10, which creates a stacking context. The navigation overlay'sz-index: 100000then only applies inside the header, so at page level the open overlay sits at10:#wpadminbar,z-index: 99999), which covers the overlay's close button on small screens (Header stick: Difficult to close the navigation overlay once opened #98);.sticky-bottom,z-index: 10), which comes later in the DOM and is painted on top of the overlay (Header Stick: Search bar is on top of the navigation overlay #99).Thanks to @prasadkarmalkar for the analysis in #99. Raising the header to
z-index: 11fixes #99 but not #98, because the admin bar is still above it. This PR lifts the sticky header toz-index: 100000only while the overlay is open, so it behaves like the default and collapsed headers. When the menu is closed, the header keepsz-index: 10and stays under the admin bar as before.Measured at 390×844 and 599×900, logged in with the admin bar showing, Header Sticky, overlay opened at the top of the page:
/wp-admin/profile.phpz-indexafter closing the menuThe default (non-sticky) header measured the same before and after.
Separate from this PR: the overlay close icon in
patterns/hidden-navigation-overlay.phphas no colour set, so it renders black on the black overlay with every header design. I can open a separate issue for that.Screenshots
Testing Instructions
Use of AI Tools
AI assistance: Yes
Used for: Initial draft of the change, measurements and this description; the change was reviewed and tested by me in Chrome.