Problem/Motivation
I found a serious misuse of colour in a high-contrast media query.
The pagination indicates the current page by drawing a circle around the number. In the full-colour scheme, a blue background is used for this link. When using a Windows high-contrast mode, this background colour is stripped away, so pager.pcss.css
uses an -ms-high-contrast: active
media query, to set an explicit WHITE border around the active item in the pager.
This isn't guaranteed to show up against the page background.
Steps to reproduce
When designing for Windows high-contrast (a.k.a. forced colours), remember to test with arbitrary user-specified colour schemes, as well as the pre-set ones.
When using one of the pre-set colour schemes with a black background, the white border shows up well:
However, when using the pre-set black-on-white colour scheme, the white border cannot be seen at all, because it's the same as the page background:
When a custom colour scheme has been chosen by the user, anything could happen. Sometimes you get lucky; here I'm using a custom yellow-on-blue scheme. The white border shows up well against the blue background:
Other times, you aren't so lucky. Here's a brown-on-peach scheme. The explicit white border doesn't show up very well.
I think I saw another instance of an explicit colour inside a high-contrast media query.
Proposed resolution
Remove this explicit white colour. Let it use a border the same colour as the link text.
Remaining tasks
Look for other instances of explicit colours in an -ms-high-contrast
media query.
User interface changes
When multiple characters are used within a pager item (eg double numbers), the circle outline can stretch into an oval. This is per the design, but was less pronounced with the white border.
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#17 | edge_pager_links_whcm_high_contrast_white.png | 60.94 KB | m4olivei |
#17 | edge_pager_links_whcm_high_contrast_black.png | 54.32 KB | m4olivei |
#17 | chrome_pager_links_whcm_high_contrast_black.png | 56.24 KB | m4olivei |
#17 | chrome_pager_links_whcm_high_contrast_white.png | 61.7 KB | m4olivei |
#17 | chrome_pager_links_normal.png | 98.97 KB | m4olivei |
Comments
Comment #2
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedScreenshots for steps-to-reproduce
Comment #3
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedThis can work easily without using any overrides in a
-ms-high-contrast
. Often, you don't need to detect when high-contrast mode is actually being used, just anticipate it.The patch here removes the border property from the high-contrast media query, and instead puts a transparent border in the main styles for the full-colour space. When a Windows high-contrast theme is used, the background colour is removed, and the border colour is overridden to whatever the high-contrast theme is using for links.
By avoiding the MS vendor media query, this works correctly in Firefox and Blink too.
Manual testing results:
In these screenshots, we see 4 browser windows. Clockwise from top-left, they are:
Using the "High contrast #1" preset colour scheme, with a black background:
Using the preset black-on-white scheme:
Using my custom yellow-on-blue scheme:
Using my custom brown-on-peach scheme:
In all these scenarios, the current page is indicated by a circular border. It follows whatever the high-contrast theme uses as a link colour (including the visited-link colour).
Comment #4
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedTriage: I gave this major priority, because it relates WCAG SC 1.4.1 Use of Color at level-A. It also relates to SC 1.4.11 Non-text Contrast at level-AA, and SC 2.4.8 Location at level-AAA.
Comment #5
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedComment #6
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedPatch #3 failed automated lint checks.
No change to properties here, just re-ordering.
Comment #7
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer commentedOkay third time lucky with the magic test bot dance. On Slack, @longwave kindly directed me to the stylelintrc file. I'm bemused by the order, but at least I have my instructions now.
No change to properties here, just re-ordering.
Comment #8
mgiffordPerhaps under contention, https://github.com/w3c/wcag/issues/623 but I'd consider it part of:
https://www.w3.org/TR/WCAG21/#info-and-relationships
Comment #9
mgiffordcorrecting tagging
Comment #11
mherchelThis looks good to me! Patch still applies, and tested this out on Edge, FF, and IE.
Screenshots:
FF - No patch
FF with patch
IE - No patch
IE with patch
Edge - no patch (note this works properly without patch)
Edge - with patch.
Comment #12
lauriiiThis does slightly change the design of current pager item for pages 10 or higher. This should be added in the issue summary, and we should confirm with one of the designers if this is acceptable.
Before:
After:
Comment #13
mherchelBleh. Yeah, that's definitely not per the design. I'll work on this.
Comment #14
mherchelScratch that! That is per the design.
The highlight turns into an elongated oval. See attached image for reference.
Comment #15
mherchelLauriii's comment in Slack
Comment #16
mherchelUpdated issue summary, and setting back to RTBC per @lauriii's slack comment.
Comment #17
m4olivei+1, RTBC from me as well! Here are some screenshots of patch from #7 which is still applying against 9.3.x:
Chrome, Normal Mode:
Chrome WHCM Black:
Chrome WHCM White:
Edge WHCM Black:
Edge WHCM White:
Comment #20
lauriiiCommitted 98a6e3e and pushed to 9.3.x. Also cherry-picked to 9.2.x because Claro is experimental. Thanks!