Repository navigation
Keep keyboard focus visible and clear of the sticky header - #145
MaggieCabrera wants to merge 1 commit into
Conversation
Draw the focus ring in the text color, 2px dotted, so it keeps its contrast in every color variation instead of following the system accent color. Buttons keep the focus state theme.json gives them. Add scroll padding so focused elements don't land under the sticky header, and let the header stick to the very top below 600px, where the admin bar scrolls away. Justify the Default and Sticky header navigation right, so submenus open toward the page instead of past the right edge. Part of #44. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. 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. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
juanfra
left a comment
There was a problem hiding this comment.
Thanks @MaggieCabrera, LGTM! I left one comment regarding the sticky header case.
|
|
||
| /* Keep focused elements from scrolling under the sticky header. */ | ||
| html:has(header.wp-block-template-part > .is-position-sticky) { | ||
| scroll-padding-block-start: calc(var(--wp-admin--admin-bar--height, 0px) + 6rem); |
There was a problem hiding this comment.
I assume the 6rem is to match the height. That would work if the padding or logo height doesn't change, but it could become an issue if they do. Maybe it's worth documenting?
|
Tested on WordPress 7.2-beta1 with this PR on current Ipsum trunk (merges cleanly), single post with the Header Sticky part, Chromium 1200×700, 25 real Tab presses after scrolling down.
Not tested: the 600px small-screen rule and the admin-bar offset on mobile. |
Description
Part of #44. Keyboard focus is now easy to see and stays on screen:
Buttons, the search field and the sticky overlay are covered in #92, #141 and #135.
Screenshots
Testing Instructions
Checked on the front end, in the Site Editor, and in all color variations.
Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Audit, fix, testing and this description. I reviewed the changes.
🤖 Generated with Claude Code