The original responsive designs for Umami Demo's header attempted to make the header for mobile view intuitive and compact by providing only Search, brand and collapsed menu icon, vs the layout for larger screens which provide search, user menu, brand and main navigation.

This design causes issues with accessibility and tab ordering #2942043: Confusing visual focus order in Umami at wide breakpoint and a non-intuitive block layout order:

---Header region---
+ Main navigation
+ Site branding
+ Search
+ User account menu

The way these header blocks have been styled also causes a potential issue with the alignment of the thin bottom border line beneath search and user menu on larger screen sizes since the border is associated with the bottom of the search and user blocks. This means they always need to match in height for the border to align.

I propose we simplify how we handle the header region by making the following changes in order to make the theme more accessible, robust in use and more intuitive for users who explore the block layout interface:

  1. Introduce a new 'Before Header' region that will hold the 'Search' block and the 'User account menu' block and take care of the bottom border line
  2. Adjust the 'Header' region to hold the 'Site branding' block and 'Main navigation' only and in that order
  3. Adjust the theming so that Search, user menu, brand and main navigation are all available at all screen sizes and always presented in the same visual order (using collapsed menu icon for main navigation at small screen sizes)
  4. Improve the theming for the responsive menu to support these changes with #2940023: [PP-1] Improve accessibility of Umami's responsive main menu in mind

Add a Before Header region - Mobile:

Umami header region mobile

Desktop:

Umami header regions desktop

Adjust the block placement and theming to include a Before Header region at all screen sizes:

Menu closed

Before header region - mobile - menu closed

Menu open

Before header region - mobile - menu open

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

kjay created an issue. See original summary.

andrewmacpherson’s picture

Accessibility note: If we have two header regions in the theme, they should both be inside the <header role="banner"> landmark region of the DOM. Something like this?

  {% if page.header_before|render|striptags|trim is not empty) or (page.header|render|striptags|trim is not empty) %}
    <header class="layout-header" role="banner">
      <div class="container">
        {% if page.header_before|render|striptags|trim is not empty %}
          {{ page.header_before }}
        {% endif %
        {% if page.header|render|striptags|trim is not empty %}
          {{ page.header }}
        {% endif %
      </div>
    </header>
  {% endif %

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

kjay’s picture

Here's a first patch for this. I've gone with 'Pre-header' as the region name though this one is tricky to name. Following @andrewmacpherson's advice and header markup we have both regions inside of the header element.

CSS changes are all for layout and csscomb only, adjusting the flexbox order and display settings. Note that I have shifted the padding that prevents elements from touching the viewport edge away from the individual elements and onto the pre-header and header regions. This should allow for any user changes to block settings, such as introducing new blocks, to avoid unsightly edge to edge layout.

Tab ordering is now consistent for items across pre-header and header.

Checked in IE11, Edge 15, 16 and 17, Firefox 50 and latest, Safari latest

Some screenshots:

Umami pre header changes - mobile

Umami pre header changes - mobile - menu expanded

Umami pre header changes - desktop

andrewmacpherson’s picture

Issue tags: +Accessibility

Tagging for a closer look later. I haven't tested it manually yet, but I took a quick look at the twig file in the patch. Confirming it follows the markup in #2.

markconroy’s picture

Status: Needs review » Reviewed & tested by the community

This, to me, looks like a huge improvement on what we currently have. I even added some blocks in to the new 'pre_header' region, and guess what? nothing broke!!! Win.

I think Andrew or other a11y maintainers will have some accessibility issues, but I think it would be best to file those as follow-up issues (for example, I couldn't tab through the header on Safari (latest version on latest MacOS), but I think the improvements this patch gives us are worth the drawback where you can tab through the header but the focus order is all over the place. We can squash those a11y issues one-by-one then without people (newbies, for example) needing to be able to apply patches/etc before they can start contributing.

Also, there are other people working on header issues which are based on the legacy implementation we have, so if we move this to RTBC and commit it, then they can work from this much cleaner codebase - and, presumably, fix their issues quicker.

andrewmacpherson’s picture

I did some manual testing of this, and it's great. It totally solves the problem of #2942043: Confusing visual focus order in Umami at wide breakpoint, so we can close that one as outdated once this is in.

Glad to see those flexbox order rules removed. That property has a big difference on the tabbing order between Firefox and WebKit/Blink browsers, so it's great whenever we can get layout right without resorting to flexbox order. It's also more robust for when evaluators try adding more blocks.

I agree with Mark that we should commit this before continuing with other header issues. They'll most likely need a re-roll as a result of this.

I couldn't tab through the header on Safari (latest version on latest MacOS

That sounds like it's down to Apple's ultra-daft system settings hurdle, where you have to turn on full keyboard navigation first. A number of years back they stopped the tab key working like it has always done in every other desktop browser on every OS since the web began, and then had the nerve to market the new setting as an advanced feature. I wouldn't worry about this - the markup looks good to me.

andrewmacpherson’s picture

Crediting finnsky, who wrote a patch in the related issue at #2942043: Confusing visual focus order in Umami at wide breakpoint. We'll end up closing that as outdated once this is in.

  • lauriii committed 6254e18 on 8.7.x
    Issue #2980528 by kjay, andrewmacpherson, markconroy, finnsky: Improve...

  • lauriii committed d222f79 on 8.6.x
    Issue #2980528 by kjay, andrewmacpherson, markconroy, finnsky: Improve...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Seems like a great improvement! 🙌 Committed 6254e18 and pushed to 8.7.x. Also chery-picked d222f79 and pushed to 8.6.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.