Make WordPress Core

Changeset 55307


Ignore:
Timestamp:
02/11/2023 05:37:30 PM (13 months ago)
Author:
joedolson
Message:

Toolbar: Prevent false positive on automated contrast testing.

The non-focused state of the .screen-reader-shortcut element in the admin bar fails contrast tests. This has no real-world consequences, but raises false positives in some automated testing tools. This fix is largely so people using automated testing will not raise false positives.

Props sabernhardt, afercia, robinwpdeveloper, re_enter_rupok.
Fixes #56789.

Location:
trunk/src
Files:
2 edited

Legend:

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

    r55150 r55307  
    142142    position: absolute;
    143143    top: -1000em;
    144 }
    145 
    146 .screen-reader-shortcut:focus {
    147144    left: 6px;
    148     top: -25px;
    149145    height: auto;
    150146    width: auto;
     
    153149    font-weight: 600;
    154150    padding: 15px 23px 14px;
     151    /* Background and color set to prevent false positives in automated accessibility tests. */
    155152    background: #f0f0f1;
    156153    color: #2271b1;
    157154    z-index: 100000;
    158155    line-height: normal;
     156}
     157
     158.screen-reader-shortcut:focus {
     159    top: -25px;
     160    /* Overrides a:focus in the admin. See ticket #56789. */
     161    color: #2271b1;
    159162    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    160163    text-decoration: none;
  • trunk/src/wp-includes/css/admin-bar.css

    r54395 r55307  
    720720    position: absolute;
    721721    top: -1000em;
    722 }
    723 
    724 #wpadminbar .screen-reader-shortcut:focus {
    725722    left: 6px;
    726     top: 7px;
    727723    height: auto;
    728724    width: auto;
     
    736732    line-height: normal;
    737733    text-decoration: none;
     734}
     735
     736#wpadminbar .screen-reader-shortcut:focus {
     737    top: 7px;
     738    background: #f0f0f1;
    738739    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    739740}
Note: See TracChangeset for help on using the changeset viewer.