Make WordPress Core

Changeset 45169


Ignore:
Timestamp:
04/12/2019 05:03:24 PM (8 years ago)
Author:
desrosj
Message:

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.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/site-health.css

    r45145 r45169  
    276276        background: #fff;
    277277        border: 0;
    278         color: #212121;
     278        color: #32373C;
    279279        cursor: pointer;
    280280        display: block;
    … …  
    319319
    320320.health-check-accordion-trigger .badge {
    321         display: inline-block;
     321        float: right;
    322322        padding: 0.1rem 0.5rem 0.15rem;
    323         background-color: #d7dade;
    324         border-radius: 3px;
    325         color: #000;
    326         font-weight: 600;
    327         margin: 0 0.5rem;
     323        color: #32373C;
     324        font-weight: 600;
     325        margin: 0 2rem 0 0.5rem;
    328326}
    329327
    330328.health-check-accordion-trigger .badge.blue {
    331         background-color: #0073af;
    332         color: #fff;
     329        border: 1px solid #BFE7F3;
    333330}
    334331
    335332.health-check-accordion-trigger .badge.orange {
    336         background-color: #ffb900;
    337         color: #000;
     333        border: 1px solid #ffb900;
    338334}
    339335
    340336.health-check-accordion-trigger .badge.red {
    341         background-color: #dc3232;
    342         color: #fff;
     337        border: 1px solid #dc3232;
    343338}
    344339
    345340.health-check-accordion-trigger .badge.green {
    346         background-color: #40860a;
    347         color: #fff;
    348 }
    349 
    350 .health-check-accordion-trigger .badge.pink {
    351         background-color: #f4b0fc;
    352         color: #000;
     341        border: 1px solid #46B450;
     342}
     343
     344.health-check-accordion-trigger .badge.purple {
     345        border: 1px solid #826EB4;
    353346}
    354347
    355348.health-check-accordion-trigger .badge.gray {
    356         background-color: #ccc;
    357         color: #000;
    358 }
    359 
    360 .health-check-accordion-trigger .badge.light-blue {
    361         background-color: #10e9fb;
    362         color: #000;
    363 }
    364 
    365 .health-check-accordion-trigger .badge.light-green {
    366         background-color: #60f999;
    367         color: #000;
     349        border: 1px solid #ccd0d4;
    368350}
    369351
  • trunk/src/wp-admin/includes/class-wp-site-health.php

    r45164 r45169  
    184184                        'badge'       => array(
    185185                                'label' => __( 'Performance' ),
    186                                 'color' => 'red',
     186                                'color' => 'blue',
    187187                        ),
    188188                        'description' => '',
    … …  
    284284                        'badge'       => array(
    285285                                'label' => __( 'Security' ),
    286                                 'color' => 'red',
     286                                'color' => 'blue',
    287287                        ),
    288288                        'description' => sprintf(
    … …  
    400400                        'badge'       => array(
    401401                                'label' => __( 'Security' ),
    402                                 'color' => 'red',
     402                                'color' => 'blue',
    403403                        ),
    404404                        'description' => sprintf(
    … …  
    624624                        'badge'       => array(
    625625                                'label' => __( 'Performance' ),
    626                                 'color' => 'red',
     626                                'color' => 'blue',
    627627                        ),
    628628                        'description' => sprintf(
    … …  
    713713                        'badge'       => array(
    714714                                'label' => __( 'Performance' ),
    715                                 'color' => 'orange',
     715                                'color' => 'blue',
    716716                        ),
    717717                        'description' => sprintf(
    … …  
    909909                        'badge'       => array(
    910910                                'label' => __( 'Performance' ),
    911                                 'color' => 'red',
     911                                'color' => 'blue',
    912912                        ),
    913913                        'description' => sprintf(
    … …  
    989989                        'badge'       => array(
    990990                                'label' => __( 'Performance' ),
    991                                 'color' => 'orange',
     991                                'color' => 'blue',
    992992                        ),
    993993                        'description' => sprintf(
    … …  
    11041104                        'badge'       => array(
    11051105                                'label' => __( 'Security' ),
    1106                                 'color' => 'red',
     1106                                'color' => 'blue',
    11071107                        ),
    11081108                        'description' => sprintf(
    … …  
    11641164                        'badge'       => array(
    11651165                                'label' => __( 'Security' ),
    1166                                 'color' => 'red',
     1166                                'color' => 'blue',
    11671167                        ),
    11681168                        'description' => sprintf(
    … …  
    12261226                        'badge'       => array(
    12271227                                'label' => __( 'Security' ),
    1228                                 'color' => 'red',
     1228                                'color' => 'blue',
    12291229                        ),
    12301230                        'description' => sprintf(
    … …  
    12891289                        'badge'       => array(
    12901290                                'label' => __( 'Security' ),
    1291                                 'color' => 'red',
     1291                                'color' => 'blue',
    12921292                        ),
    12931293                        'description' => sprintf(
    … …  
    13351335                        'badge'       => array(
    13361336                                'label' => __( 'Performance' ),
    1337                                 'color' => 'orange',
     1337                                'color' => 'blue',
    13381338                        ),
    13391339                        'description' => sprintf(
    … …  
    13961396                        'badge'       => array(
    13971397                                'label' => __( 'Security' ),
    1398                                 'color' => 'red',
     1398                                'color' => 'blue',
    13991399                        ),
    14001400                        'description' => sprintf(
    … …  
    14721472                        'badge'       => array(
    14731473                                'label' => __( 'Performance' ),
    1474                                 'color' => 'orange',
     1474                                'color' => 'blue',
    14751475                        ),
    14761476                        'description' => sprintf(
    … …  
    15141514                        'badge'       => array(
    15151515                                'label' => __( 'Performance' ),
    1516                                 'color' => 'orange',
     1516                                'color' => 'blue',
    15171517                        ),
    15181518                        'description' => sprintf(
    … …  
    15851585                        'badge'       => array(
    15861586                                'label' => __( 'Performance' ),
    1587                                 'color' => 'orange',
     1587                                'color' => 'blue',
    15881588                        ),
    15891589                        'description' => sprintf(
Note: See TracChangeset for help on using the changeset viewer.