Make WordPress Core


Ignore:
Timestamp:
01/07/2019 03:59:04 PM (8 years ago)
Author:
SergeyBiryukov
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.
Merges [44376] to the 5.0 branch.
Fixes #45713.

Location:
branches/5.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0

  • branches/5.0/src/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss

    r43909 r44426  
    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
    … …  
    183216                        }
    184217
     218                        > .menu-item-link-return {
     219                                width: 100%;
     220                                font-size: $font__size_base;
     221                                font-weight: normal;
     222                                text-align: left;
     223                        }
     224
    185225                        > a:empty {
    186226                                display: none;
Note: See TracChangeset for help on using the changeset viewer.