Skip to content

Header Sticky: Keep the open navigation overlay above the admin bar and Search Bar - #135

Open
rahultank-spaceo wants to merge 2 commits into
WordPress:trunkfrom
rahultank-spaceo:fix/98-sticky-header-overlay
Open

rahultank-spaceo wants to merge 2 commits into
WordPress:trunkfrom
rahultank-spaceo:fix/98-sticky-header-overlay

Conversation

@rahultank-spaceo

Copy link
Copy Markdown

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's z-index: 100000 then only applies inside the header, so at page level the open overlay sits at 10:

Thanks to @prasadkarmalkar for the analysis in #99. Raising the header to z-index: 11 fixes #99 but not #98, because the admin bar is still above it. This PR lifts the sticky header to z-index: 100000 only while the overlay is open, so it behaves like the default and collapsed headers. When the menu is closed, the header keeps z-index: 10 and 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:

Check Before (trunk) After
Element at the close button's centre admin bar account link close button
Clicking the close button position opens /wp-admin/profile.php closes the overlay
Element at the Search Bar's centre search button (above the overlay) overlay
Header z-index after closing the menu 10 10

The default (non-sticky) header measured the same before and after.

Separate from this PR: the overlay close icon in patterns/hidden-navigation-overlay.php has 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

  1. Activate Ipsum and make sure the admin bar shows on the front end.
  2. In the Site Editor, set the header template part to the Header Sticky design and save.
  3. On the front end, narrow the window below 600px and stay at the top of the page.
  4. Open the navigation overlay.
  5. Before: the close button sits under the admin bar and the Search Bar shows above the overlay. After: the close button can be clicked (and reached with Tab), and the overlay covers the Search Bar.
  6. Close the menu and scroll: the sticky header still sits below the admin bar and above the content.

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.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: rahultank-spaceo <rahultank@git.wordpress.org>
Co-authored-by: prasadkarmalkar <prasadkarmalkar@git.wordpress.org>
Co-authored-by: carolinan <poena@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. First-time Contributor Pull request opened by a first-time contributor to the repository labels Oct 6, 2026
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

👋 Thanks for your first pull request, @rahultank-spaceo! We'll take a look soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. First-time Contributor Pull request opened by a first-time contributor to the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Header Stick: Search bar is on top of the navigation overlay Header stick: Difficult to close the navigation overlay once opened

1 participant