Fix misaligned show/hide icon in password fields#12472
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. |
Description
Trac ticket: https://core.trac.wordpress.org/ticket/65605
The password visibility (show/hide) toggle icon is misaligned within the password field on the Users → Add New User screen. The eye icon does not line up correctly with the "Hide"/"Show" label inside the button.
Root cause
This regressed from the fix for #65031, which corrected the same misalignment on the Profile / Edit User screen. That fix scoped the alignment CSS to a new
.user-new-password-toggleclass and only added that class to the button inuser-edit.php:The Add New User screen (
user-new.php) uses the identical show/hide button (.button.wp-hide-pwwith a.dashiconsicon +.textlabel) but never received the class, so its icon fell back to inlinevertical-align: middleand rendered misaligned.Fix
Instead of adding the marker class to each screen, the alignment rule is generalized to target the toggle buttons directly, so every show/hide/cancel password button is aligned consistently with no per-screen markup:
The now-redundant
.user-new-password-toggleclass is removed fromuser-edit.php.Testing Instructions
Screenshots
Before on user-new.php -

After on user-new.php

Before on profile.php (no-change)

After on profile.php

Before on options-writing.php (no-change)

After on options-writing.php
