Make WordPress Core


Ignore:
Timestamp:
01/10/2019 04:46:44 PM (7 years ago)
Author:
afercia
Message:

Accessibility: Add focus styles for Windows High Contrast mode.

Introduces in core new focus styles dedicated to Windows High Contrast mode. The
new styles use a transparent CSS outline as already explored in the Block Editor.
This first part covers some of the main user interface controls like buttons, links,
and media views elements. Other parts will be addressed in the next future.

Fixes #41286.

Location:
trunk/src/wp-includes/css
Files:
3 edited

Legend:

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

    r44349 r44544  
    5454#wpadminbar a img,
    5555#wpadminbar a img:hover {
    56     outline: none;
    5756    border: none;
    5857    text-decoration: none;
     
    7271#wpadminbar div {
    7372    box-shadow: none;
    74     outline: none;
     73}
     74
     75#wpadminbar a:focus {
     76    /* Inherits transparent outline only visible in Windows High Contrast mode */
     77    outline-offset: -1px;
    7578}
    7679
  • trunk/src/wp-includes/css/buttons.css

    r43309 r44544  
    9393}
    9494
     95/* Only visible in Windows High Contrast mode */
    9596.wp-core-ui .button:active,
    9697.wp-core-ui .button:focus {
    97     outline: none;
     98    outline: 2px solid transparent;
     99    /* Reset inherited offset from Gutenberg */
     100    outline-offset: 0;
    98101}
    99102
     
    191194    border-radius: 0;
    192195    background: none;
    193     outline: none;
    194196    cursor: pointer;
    195197    text-align: left;
     
    212214        0 0 0 1px #5b9dd9,
    213215        0 0 2px 1px rgba(30, 140, 190, .8);
     216    /* Only visible in Windows High Contrast mode */
     217    outline: 1px solid transparent;
    214218}
    215219
     
    281285
    282286.wp-core-ui .button.button-primary.button-hero {
    283  box-shadow: 0 2px 0 #006799;
     287    box-shadow: 0 2px 0 #006799;
    284288}
    285289
     
    288292.wp-core-ui .button.button-primary.button-hero.active:focus,
    289293.wp-core-ui .button.button-primary.button-hero:active {
    290  box-shadow: inset 0 3px 0 #006799;
     294    box-shadow: inset 0 3px 0 #006799;
    291295}
    292296
  • trunk/src/wp-includes/css/media-views.css

    r44343 r44544  
    4949        0 0 0 1px #5b9dd9,
    5050        0 0 2px 1px rgba(30, 140, 190, .8);
    51     outline: none;
    5251    color: #124964;
     52    /* Only visible in Windows High Contrast mode */
     53    outline: 1px solid transparent;
    5354}
    5455
     
    196197    border-color: #5b9dd9;
    197198    box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
     199    /* Only visible in Windows High Contrast mode */
     200    outline: 2px solid transparent;
     201    outline-offset: -2px;
    198202}
    199203
     
    836840        inset 0 0 2px 3px #fff,
    837841        inset 0 0 0 7px #5b9dd9;
    838     outline: none;
     842    /* Only visible in Windows High Contrast mode */
     843    outline: 2px solid transparent;
     844    outline-offset: -6px;
    839845}
    840846
     
    10101016        0 0 0 1px #fff,
    10111017        0 0 0 2px #0073aa;
     1018}
     1019
     1020.wp-core-ui .attachment.selected .check:focus {
     1021    /* Only visible in Windows High Contrast mode */
     1022    outline: 2px solid transparent;
    10121023}
    10131024
     
    14861497        0 0 0 1px #fff,
    14871498        0 0 2px 3px #5b9dd9;
     1499    /* Only visible in Windows High Contrast mode */
     1500    outline: 2px solid transparent;
    14881501}
    14891502
     
    17781791    color: #0074a2;
    17791792    border-color: #5b9dd9;
    1780     outline: none;
    17811793    box-shadow: 0 0 3px rgba( 0, 115, 170, .8 );
     1794    /* Only visible in Windows High Contrast mode */
     1795    outline: 2px solid transparent;
    17821796}
    17831797
Note: See TracChangeset for help on using the changeset viewer.