Skip to content

Stick the header to the top on small screens when logged in - #159

Open
MaggieCabrera wants to merge 1 commit into
trunkfrom
fix/sticky-header-admin-bar-mobile
Open

MaggieCabrera wants to merge 1 commit into
trunkfrom
fix/sticky-header-admin-bar-mobile

Conversation

@MaggieCabrera

Copy link
Copy Markdown
Contributor

Description

On screens 600px wide or less, logged-in users saw a 46px gap above the Sticky Header once they scrolled, with page content showing through it. At that width the admin bar scrolls away with the page, but the header still left room for it. The admin bar offset now only applies above 600px, where the bar is fixed, so on small screens the header sticks at the top, like core's sticky blocks do.

There's no issue for this. I found it while auditing style.css.

Screenshots

Testing Instructions

  1. In the Site Editor, switch the header to Header Sticky and save.
  2. Log in and open any post at 375px wide.
  3. Scroll down. The header sticks at the very top, with no gap above it.
  4. Try 700px and 1280px wide. The header still sticks right below the admin bar.
  5. Log out. The header sticks at the top at every width, as before.

I checked the front end at 1280, 783, 782, 601, 600 and 375px, logged in and out, with the default colors and with Evening. Only 600px and below changes, and only when logged in. The Site Editor isn't affected, since its canvas has no admin bar, and the header still sticks there.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Finding the gap during a style.css audit, writing the fix and checking it at each admin bar breakpoint.

🤖 Generated with Claude Code

At 600px and below, the admin bar scrolls away with the page, but the
sticky header still left 46px for it, so content showed above the
header. The admin bar offset now only applies above 600px, where the
bar is fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the [Area] Global Styles Issues or PRs that touch theme.json or the base stylesheet. label Oct 20, 2026
@github-actions

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: MaggieCabrera <onemaggie@git.wordpress.org>

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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant