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

Blocks use custom selection color #15270

Closed
karlgroves opened this issue Apr 30, 2019 · 9 comments · Fixed by #16835
Closed

Blocks use custom selection color #15270

karlgroves opened this issue Apr 30, 2019 · 9 comments · Fixed by #16835
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended

Comments

@karlgroves
Copy link

Blocks use custom selection color

  • Severity: Low
  • Affected Populations:
    • Low-Vision
  • Platform(s):
    • All / Universal
  • Components affected:
    • Block Editing
    • Block Options

Issue description

Blocks use a custom CSS color for text selection.

For Firefox users who have low-vision and use a Windows high-contrast
theme, custom selection colors are not honoured, but are not replaced by
defaults either. Consequently, these users will not be able to see what
text is selected.

Issue Code
    .editor-block-list__layout .editor-block-list__block ::selection {
        background-color: #b3e7fe;
    }

Remediation Guidance

Remove custom selection rules, and allow the browser/OS native color to
be rendered.

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-97 in Tenon's report

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

afercia commented May 1, 2019

To my knowledge, Firefox honors ::selection (at least on macOS?). I'd agree on the general issue that the best option is to not play with operating system defaults. Will take care to propose this issue for discussion during next accessibility team meeting.

@gziolo gziolo added the Needs Design Feedback Needs general design feedback. label May 4, 2019
@melchoyce
Copy link
Contributor

Full report screenshot:

image

@StommePoes
Copy link

StommePoes commented May 5, 2019

To my knowledge, Firefox honors ::selection (at least on macOS?).

MacOS doesn't have a real full high contrast setting compared to what Windows does (to my knowledge, unless I'm out of date?).
I could have sworn there was a filed Bugzilla on this however I am having trouble finding it. :(
It is still easily reproduceable on a fresh latest Firefox and Windows High Contrast however:
Four cropped screenshots of Firefox: first is an invisible selection in windows high contrast; second is the selection after focus has left Firefox; third is the selection without windows high contrast; last is the selection after focus has left Firefox

The second and last images are when you have selected something and then for example clicked another desktop application (allowing focus to leave Firefox without removing the selection).

These are without any changes to Firefox colour settings, which I kind of assume would change these results? But I'm not sure.

@afercia
Copy link
Contributor

afercia commented May 5, 2019

Right, I missed the "and use a Windows high-contrast theme" part :)

@afercia afercia added [Type] Bug An existing feature does not function as intended [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 5, 2019
@mapk
Copy link
Contributor

mapk commented May 14, 2019

I'll take a look at this. In today's triage on slack, the Design Team agreed to just use the browser's default highlight if possible. How this effects high contrast modes will probably need further work.

@mapk mapk added Needs Dev Ready for, and needs developer efforts and removed Needs Design Feedback Needs general design feedback. labels May 14, 2019
@StommePoes
Copy link

Leaving selection to the default will Just Work.
This bug is something to do with how Firefox deals with how it reads the Highlight colour from Windowing software (so Windows just has... Windows) as there are bugs on similar issues on Linux (where various Gnome High Contrast schemes meet terrible ends when run with Firefox which also allows users to set certain window colours, as well as how FF deals with windowing themes... it's a bit of a mess).

@mapk
Copy link
Contributor

mapk commented May 15, 2019

So @StommePoes, thanks for your detailed comments. In your experience, Windows high contrast mode in FF will still show the text as highlighted if we use the default browser selection highlight? Is that correct?

@m-e-h
Copy link
Member

m-e-h commented May 16, 2019

This issue was also brought up in sanitize.css. csstools/sanitize.css#173

@StommePoes
Copy link

StommePoes commented May 17, 2019

@mapk correct. As in, simply not having a ::selection or -moz-selection anything in the CSS at all.

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). Needs Dev Ready for, and needs developer efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
7 participants