Site Health: Improve the test badge implementation.

Label badges for each Site Health test currently display in either red, orange, or green, regardless of if the test passed or failed. This is confusing, as seeing red labels in the “Passed Test” section could alarm users (when really everything is OK and no action is required), and seeing green labels in the “Failed Tests” section would not appropriately encourage the user to take appropriate action.

This change makes several improvements to the label badges:

- Always right align the badges for consistent display.
- Remove background fill for badges. Instead, use a border.
- Use a consistent styling for all tests (passed and failed).
- The text color no longer uses true black (#000000).
- The `.badge.pink` CSS definition has been switched to `.badge.purple`, and the definitions for blue, gray, and green have also been updated to more closely follow the official WordPress color palette.

Props: pbiron, garrett-eclipse, hedgefield, Clorith, xkon, melchoyce, mdwolinski, alexdenning.
Fixes #46623.
Built from https://develop.svn.wordpress.org/trunk@45169


git-svn-id: http://core.svn.wordpress.org/trunk@44978 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2019-04-12 17:04:52 +00:00
parent 21da589622
commit 5bafb4ea2d
6 changed files with 41 additions and 77 deletions

View File

@ -275,7 +275,7 @@
.health-check-accordion-trigger {
background: #fff;
border: 0;
color: #212121;
color: #32373C;
cursor: pointer;
display: block;
font-weight: 400;
@ -318,53 +318,35 @@
}
.health-check-accordion-trigger .badge {
display: inline-block;
float: left;
padding: 0.1rem 0.5rem 0.15rem;
background-color: #d7dade;
border-radius: 3px;
color: #000;
color: #32373C;
font-weight: 600;
margin: 0 0.5rem;
margin: 0 0.5rem 0 2rem;
}
.health-check-accordion-trigger .badge.blue {
background-color: #0073af;
color: #fff;
border: 1px solid #BFE7F3;
}
.health-check-accordion-trigger .badge.orange {
background-color: #ffb900;
color: #000;
border: 1px solid #ffb900;
}
.health-check-accordion-trigger .badge.red {
background-color: #dc3232;
color: #fff;
border: 1px solid #dc3232;
}
.health-check-accordion-trigger .badge.green {
background-color: #40860a;
color: #fff;
border: 1px solid #46B450;
}
.health-check-accordion-trigger .badge.pink {
background-color: #f4b0fc;
color: #000;
.health-check-accordion-trigger .badge.purple {
border: 1px solid #826EB4;
}
.health-check-accordion-trigger .badge.gray {
background-color: #ccc;
color: #000;
}
.health-check-accordion-trigger .badge.light-blue {
background-color: #10e9fb;
color: #000;
}
.health-check-accordion-trigger .badge.light-green {
background-color: #60f999;
color: #000;
border: 1px solid #ccd0d4;
}
.health-check-accordion-trigger[aria-expanded="true"] .icon {

File diff suppressed because one or more lines are too long

View File

@ -275,7 +275,7 @@
.health-check-accordion-trigger {
background: #fff;
border: 0;
color: #212121;
color: #32373C;
cursor: pointer;
display: block;
font-weight: 400;
@ -318,53 +318,35 @@
}
.health-check-accordion-trigger .badge {
display: inline-block;
float: right;
padding: 0.1rem 0.5rem 0.15rem;
background-color: #d7dade;
border-radius: 3px;
color: #000;
color: #32373C;
font-weight: 600;
margin: 0 0.5rem;
margin: 0 2rem 0 0.5rem;
}
.health-check-accordion-trigger .badge.blue {
background-color: #0073af;
color: #fff;
border: 1px solid #BFE7F3;
}
.health-check-accordion-trigger .badge.orange {
background-color: #ffb900;
color: #000;
border: 1px solid #ffb900;
}
.health-check-accordion-trigger .badge.red {
background-color: #dc3232;
color: #fff;
border: 1px solid #dc3232;
}
.health-check-accordion-trigger .badge.green {
background-color: #40860a;
color: #fff;
border: 1px solid #46B450;
}
.health-check-accordion-trigger .badge.pink {
background-color: #f4b0fc;
color: #000;
.health-check-accordion-trigger .badge.purple {
border: 1px solid #826EB4;
}
.health-check-accordion-trigger .badge.gray {
background-color: #ccc;
color: #000;
}
.health-check-accordion-trigger .badge.light-blue {
background-color: #10e9fb;
color: #000;
}
.health-check-accordion-trigger .badge.light-green {
background-color: #60f999;
color: #000;
border: 1px solid #ccd0d4;
}
.health-check-accordion-trigger[aria-expanded="true"] .icon {

File diff suppressed because one or more lines are too long

View File

@ -183,7 +183,7 @@ class WP_Site_Health {
'status' => '',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'red',
'color' => 'blue',
),
'description' => '',
'actions' => '',
@ -283,7 +283,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -399,7 +399,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -623,7 +623,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -712,7 +712,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p><p>%s</p>',
@ -908,7 +908,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -988,7 +988,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1103,7 +1103,7 @@ class WP_Site_Health {
'status' => '',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1163,7 +1163,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1225,7 +1225,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1288,7 +1288,7 @@ class WP_Site_Health {
'status' => '',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1334,7 +1334,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1395,7 +1395,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Security' ),
'color' => 'red',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1471,7 +1471,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1513,7 +1513,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',
@ -1584,7 +1584,7 @@ class WP_Site_Health {
'status' => 'good',
'badge' => array(
'label' => __( 'Performance' ),
'color' => 'orange',
'color' => 'blue',
),
'description' => sprintf(
'<p>%s</p>',

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.2-beta2-45168';
$wp_version = '5.2-beta2-45169';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.