Login and Registration: Improve HTML for errors and notices.

Improve markup on Login and Registration errors. Use list markup for multiple issues, paragraph when only one to reduce semantic burden in the most common case. Normalize classes and markup for wrapper using `wp_admin_notice()` and `wp_get_admin_notice()` functions. Move definition of those functions from `wp-admin\includes\misc.php` to `wp-includes\functions.php`. Move tests to functions group. 

Props extendwings, sabernhardt, afercia, lukecavanagh, rianrietveld, oglekler, sergeybiryukov, costdev, joedolson.
Fixes #30685.

git-svn-id: https://develop.svn.wordpress.org/trunk@56654 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Joe Dolson
2023-09-21 18:22:10 +00:00
parent fa0969d06a
commit b9adbb33da
6 changed files with 249 additions and 168 deletions

View File

@@ -42,8 +42,8 @@ p {
}
.login .message,
.login .success,
.login #login_error {
.login .notice,
.login .success {
border-left: 4px solid #72aee6;
padding: 12px;
margin-left: 0;
@@ -57,10 +57,19 @@ p {
border-left-color: #00a32a;
}
.login #login_error {
/* Match border color from common.css */
.login .notice-error {
border-left-color: #d63638;
}
.login .login-error-list {
list-style: none;
}
.login .login-error-list li + li {
margin-top: 4px;
}
#loginform p.submit,
.login-action-lostpassword p.submit {
border: none;
@@ -237,6 +246,11 @@ p {
margin-bottom: 0;
}
#login form .indicator-hint,
#login #reg_passmail {
margin-bottom: 16px;
}
#login form p.submit {
margin: 0;
padding: 0;
@@ -342,9 +356,7 @@ p {
font-family: Consolas, Monaco, monospace;
}
.js.login input.password-input,
.js.login-action-rp form .input,
.js.login-action-rp input[type="text"] {
.js.login input.password-input {
padding-right: 2.5rem;
}
@@ -354,6 +366,8 @@ p {
background: #fff;
}
.js.login-action-resetpass input[type="text"],
.js.login-action-resetpass input[type="password"],
.js.login-action-rp input[type="text"],
.js.login-action-rp input[type="password"] {
margin-bottom: 0;