Repository navigation
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @ThaDeKur. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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:
|
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
https://core.trac.wordpress.org/ticket/65878
This is a first step toward a consistent 2 CSS pixel focus indicator across the admin. It only fixes the outlier rules listed in the ticket comments, so the approach can be reviewed on a small diff before the full sweep.
The rule being proposed
box-shadow: 0 0 0 1px var(--wp-admin-theme-color). Total: 2px.box-shadow: 0 0 0 2px var(--wp-admin-theme-color). Total: 2px.--wp-admin-border-width-focus. It resolves to 1.5px on high-DPI screens, which is thinner than the native 2px focus style and matches the icon stroke width.Changes
.wrap .page-title-action:focus(common.css): replaced the hardcoded#3582c4with--wp-admin-theme-color, so the focus color follows the admin color scheme..wrap .page-title-action:focus(colors/_admin.scss): changed the box-shadow from--wp-admin-border-width-focusto1px. The button now shows a 2px ring whether or not a color scheme stylesheet loads. Before, it was 2px without one and 2.5–3px with one..customize-control .attachment-media-view .button-add-media:focus(customize-controls.css): replaced#3582c4with--wp-admin-theme-color..media-widget-control .attachment-media-view .button-add-media:focus(widgets.css): replaced the old blurred0 0 3pxglow in#4f94d4with a 1px theme-colored border plus a 1px shadow..login .button.wp-hide-pw:focusand.imgedit-help-toggle:focus(media.css,media-views.css) already follow the rule and are unchanged.Only the source files are changed. The
-rtl.cssand.min.cssfiles are generated during the build.Testing instructions
Test on a standard display and a 2x (high-DPI) display. Move focus with the Tab key. Measure the ring in screen pixels or a zoomed screenshot; devtools may not show the real thickness.
Next steps (not in this PR)
--wp-admin-border-width-focusacross 21 source files, pluscolors/_admin.scssandcolors/_mixins.scss..wp-color-result:focus(color-picker.css),.ui-button:focus(jquery-ui-dialog.css),.mce-window .mce-btn:focus(editor.css) and.background-position-control input[type="radio"]:focus ~ .button(themes.css).--wp-admin-border-width-focusin Gutenberg (@wordpress/base-styles).Trac ticket: https://core.trac.wordpress.org/ticket/65878
Use of AI Tools
AI assistance: Yes
Tool(s): Kiro
Model(s): Claude Opus 5.5
Used for: Auditing the focus rules in the admin CSS, drafting the CSS changes, the commit message and this description. I reviewed every change and tested it in the browser.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.