From 3bba7f2f31cf486efcb4305773b7140d15c3d804 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 12 Apr 2019 17:03:24 +0000 Subject: [PATCH] Site Health: Improve the test badge implementation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. git-svn-id: https://develop.svn.wordpress.org/trunk@45169 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/site-health.css | 40 +++++-------------- .../includes/class-wp-site-health.php | 32 +++++++-------- 2 files changed, 27 insertions(+), 45 deletions(-) diff --git a/src/wp-admin/css/site-health.css b/src/wp-admin/css/site-health.css index 1a9c8cd667..29cd443faa 100644 --- a/src/wp-admin/css/site-health.css +++ b/src/wp-admin/css/site-health.css @@ -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 { diff --git a/src/wp-admin/includes/class-wp-site-health.php b/src/wp-admin/includes/class-wp-site-health.php index 0fe620d9f9..15bdf418f3 100644 --- a/src/wp-admin/includes/class-wp-site-health.php +++ b/src/wp-admin/includes/class-wp-site-health.php @@ -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( '

%s

', @@ -399,7 +399,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -623,7 +623,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -712,7 +712,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

%s

', @@ -908,7 +908,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -988,7 +988,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1103,7 +1103,7 @@ class WP_Site_Health { 'status' => '', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1163,7 +1163,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1225,7 +1225,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1288,7 +1288,7 @@ class WP_Site_Health { 'status' => '', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1334,7 +1334,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1395,7 +1395,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Security' ), - 'color' => 'red', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1471,7 +1471,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1513,7 +1513,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

', @@ -1584,7 +1584,7 @@ class WP_Site_Health { 'status' => 'good', 'badge' => array( 'label' => __( 'Performance' ), - 'color' => 'orange', + 'color' => 'blue', ), 'description' => sprintf( '

%s

',