Login: Replace hardcoded focus color with CSS variable#12594
Login: Replace hardcoded focus color with CSS variable#12594HasnainAshfaq wants to merge 1 commit into
Conversation
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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. |
|
Thanks for the PR @HasnainAshfaq! Could you also attach some screenshots in the PR, including before and after pics? |
Thanks for the review @nimesh-xecurify! Here are the before and after screenshots: Before (unfixed - focus color is hardcoded #043959, dark teal):
After (fixed - focus color uses var(--wp-admin-theme-color-darker-20), consistent with hover):
The change ensures the focus state matches the hover state and adapts correctly to all admin color schemes. |
Replaces the hardcoded color value #043959 with var(--wp-admin-theme-color-darker-20) for focus states on login page links, consistent with how the hover state is already styled. Fixes https://core.trac.wordpress.org/ticket/64953
9606103 to
72220af
Compare
There was a problem hiding this comment.
Pull request overview
Updates the login screen link focus styles to use the admin theme CSS token instead of a legacy hardcoded hex color, ensuring the focus state matches the already-tokenized hover state and adapts to different admin color schemes.
Changes:
- Replaced
#043959withvar(--wp-admin-theme-color-darker-20)for the globala:focuscolor. - Replaced
#043959withvar(--wp-admin-theme-color-darker-20)for focus styles on login navigation/back links and the logo link.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Summary
Fixes the focus color on login page links (
← Go to [Site Name],Lost your password?, and the WP logo link) which were still using the old hardcoded color#043959instead of the updated admin theme color variable.#043959withvar(--wp-admin-theme-color-darker-20)in thea:focusrule#043959withvar(--wp-admin-theme-color-darker-20)in the.login #nav a:focus, .login #backtoblog a:focus, .login h1 a:focusruleThe hover state for these same selectors already correctly uses
var(--wp-admin-theme-color-darker-20)— this change makes focus consistent with hover.Trac Ticket
https://core.trac.wordpress.org/ticket/64953
Test Plan
/wp-login.phpLost your password?and← Go to [Site Name]