Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Focus not visible on block types in High Contrast modes #15327

Closed
karlgroves opened this issue Apr 30, 2019 · 3 comments
Closed

Focus not visible on block types in High Contrast modes #15327

karlgroves opened this issue Apr 30, 2019 · 3 comments
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).

Comments

@karlgroves
Copy link

Focus not visible on block types in High Contrast modes

  • Severity: Medium
  • Affected Populations:
    • Low-Vision
    • Motor Impaired
  • Platform(s):
    • Windows - High Contrast
  • Components affected:
    • Add Block

Issue description

When users of Windows High Contrast mode navigate between potential
block types, an outline is added to the currently-focussed block.
However this outline is pulled inwards with an outline-offset
property, which sets it directly over the border. This makes it
difficult to tell which element is focussed in browsers which support
that property (currently all except IE).

All interactive elements should have a visible and obvious focus
indicator even for high contrast users, so that sighted keyboard users
have a clear indication of which element has focus.

Issue Code
    .editor-block-types-list__item:not(:disabled).is-active, .editor-block-types-list__item:not(:disabled):active, .editor-block-types-list__item:not(:disabled):focus {


        outline: 0;


        ...


        outline: 2px solid transparent;


        outline-offset: -2px;


    }

Remediation Guidance

Remove the outline-offset rule and allow the outline to sit outside
the border.

Recommended Code
    .editor-block-types-list__item:not(:disabled).is-active, .editor-block-types-list__item:not(:disabled):active, .editor-block-types-list__item:not(:disabled):focus {


        ...


        outline: 2px solid transparent;


    }

Relevant standards

Note: This issue may be a duplicate with other existing accessibility-related bugs in this project. This issue comes from the Gutenberg accessibility audit, performed by Tenon and funded by WP Campus. This issue is GUT-17 in Tenon's report

@gziolo gziolo added the Needs Accessibility Feedback Need input from accessibility label Apr 30, 2019
@melchoyce
Copy link
Contributor

Screenshot from full report:

image

@afercia
Copy link
Contributor

afercia commented May 8, 2019

Direct comparison:

  • on the left: IE11 – focus transparent outline is visible (no support for outline-offset)
  • on the right: Edge – focus transparent outline is not visible (does support outline-offset)

Screenshot (221)

As far as I remember, the outline-offset was implemented because at that time it looked better on some buttons. As it doesn't work correctly for all elements, simplest option is to just remove it.

Worth noting there are other elements where the negative offset makes the transparent outline not visible, for example the Block toolbar buttons. See screenshot below, where the "Bold" button is focused (Edge):

Screenshot (223)

@afercia afercia added [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). and removed Needs Accessibility Feedback Need input from accessibility labels May 8, 2019
@tellthemachines
Copy link
Contributor

Closing this issue as it was fixed by #16554.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

No branches or pull requests

6 participants