Repository navigation
Conversation
🤖 PR meta 🤖🎉 PropsIf 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:
Updated as activity occurs, without notifying anyone named here. Add the |
|
While working on this, I tried something and added a focus ring around the button while you edit its text. When you click into a button and type something like "Learn more", the text field gets focused. The trunk only shows a blinking caret when editing the text on a button. With this change, the shared focus ring shows around the whole button, so it's clear which button you're working on. It's a big help in high contrast mode too, as you'll see - Trunk: Screen.Recording.2026-10-23.at.20.39.04.movWith this experiment: Screen.Recording.2026-10-23.at.18.43.47.movThe rule I added: .wp-block-button__link:focus {
@include outset-ring__focus();
}Does this feel like an improvement to you? |
|
No actionable comments were generated in the recent review. ℹ️ Recent review info
📝 Summary
Merge Risk:
|
3afd668 to
5e6d188
Compare
t-hamano
left a comment
There was a problem hiding this comment.
Nice catch! It looks like this outline style was introduced in #15058. It may have been necessary at the time, but I don't think it's needed in the current UI anymore.
While working on this, I tried something and added a focus ring around the button while you edit its text. When you click into a button and type something like "Learn more", the text field gets focused. The trunk only shows a blinking caret when editing the text on a button. With this change, the shared focus ring shows around the whole button, so it's clear which button you're working on. It's a big help in high contrast mode too, as you'll see -
I think this applies not only to the Button block but to every block that uses the RichText component. Adding special handling only to the Button block doesn't seem ideal to me. Also, I believe this focus ring is meant for the UI that makes up WordPress, not for blocks.
Co-Authored-By: Claude <noreply@anthropic.com>
What?
Remove the Button block wrapper's overridden focus styles and unused Sass import. See #80138.
Why?
The wrapper's focus rule doesn't draw the ring shown in the editor. Block-list styles override its outline with
outline: noneand draw the visible selection ring on::after. The parent Buttons block also clears the wrapper's focus shadow. Replacing the suppressed outline with the shared focus mixin adds no visible benefit.How?
Remove the redundant
.wp-block-button:focusrule and its unused import.Testing Instructions
document.querySelector('[data-type="core/button"]').focus(). Check that the existing block-selection ring remains visible. Inspect::afterto see where that ring comes from.Testing Instructions for Keyboard
Screenshots or screencast
No visual change is expected.
Use of AI Tools
Implemented with assistance of Codex (Astra 6)
@coderabbitai review