Make WordPress Core


Ignore:
Timestamp:
12/31/2018 05:48:08 PM (6 years ago)
Author:
laurelfulford
Message:

Twenty Nineteen: Improve menu semantics and keyboard navigation.

The menu's original markup included some non-semantic tags and an unnecessary tabindex attribute that made it difficult to navigate via keyboard.

Props allancole, anevins, kjellr.
Fixes #45713.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss

    r44368 r44376  
    1212    > div {
    1313        display: inline;
     14    }
     15
     16    /* Un-style buttons */
     17    button {
     18        display: inline-block;
     19        border: none;
     20        padding: 0;
     21        margin: 0;
     22        font-family: $font__heading;
     23        font-weight: 700;
     24        line-height: $font__line-height-heading;
     25        text-decoration: none;
     26        background: transparent;
     27        color: inherit;
     28        cursor: pointer;
     29        transition: background 250ms ease-in-out,
     30                    transform 150ms ease;
     31        -webkit-appearance: none;
     32        -moz-appearance: none;
     33
     34        &:hover,
     35        &:focus {
     36            background: transparent;
     37        }
     38
     39        &:focus {
     40            outline: 1px solid transparent;
     41            outline-offset: -4px;
     42        }
     43
     44        &:active {
     45            transform: scale(0.99);
     46        }
    1447    }
    1548
     
    184217            }
    185218
     219            > .menu-item-link-return {
     220                width: 100%;
     221                font-size: $font__size_base;
     222                font-weight: normal;
     223                text-align: left;
     224            }
     225
    186226            > a:empty {
    187227                display: none;
Note: See TracChangeset for help on using the changeset viewer.