jupyter / jupyter/jupyter.github.io

Black text on solid colours is less accessible than the contrast checker tells you

Open
#587 10 comments 1 reaction 0 assignees View on GitHub
help wanted user-feedback
Dominant language
HTML
Stars
207
Forks
205
Avg merge
1d 3h
Merged PRs (30d)
10

Description

So I am struggling with this for a long time due to some changes in JupyterLab (and elsewhere) and now on this website too.

TLDR: The tools that measure color contrast are _wrong_ (for a certain definition of wrong). Please do user testing; please use APCA from upcoming WCAG 3. Do not listen to contrast checkers blindly.

The old way of displaying white text on blue or orange seems to be working better for me, even though it technically fails in contrast checker audits. There are many articles written on it, but I would like to highlight [The Myths of Color Contrast Accessibility](https://uxmovement.com/buttons/the-myths-of-color-contrast-accessibility/) (_Myth 1: The WCAG requirements are always optimal_) and especially relevant due to our brand colour [Orange You Accessible? A Mini Case Study on Color Ratio](https://www.bounteous.com/insights/2019/03/22/orange-you-accessible-mini-case-study-color-ratio/):

> ![image](https://user-images.githubusercontent.com/5832902/147786293-ad60b264-41b1-4da5-abc7-2ca6436fe712.png)
> ![image](https://user-images.githubusercontent.com/5832902/147786328-5d0c9d48-a1eb-486e-a501-df77d56b79b6.png)

There may not be consensus on this one, and I may be in minority of users with mild colour blindness which find the black on orange and black on blue annoying, but I just wanted to share it. I really think that the designers who worked on Jupyter colour palette did a great job and I don't feel we need to force-change the colours based solely on the tools which calculate contrast.

I do feel that using more subtle changes like adjusting `text-shadow` (and not just with black/white colour, but to carefully selected shade of the relevant colour), which is in WCAG guidelines but unfortunately is not properly accounted for by Lighthouse and friends, is much better way. I do hope that this will change, Lighthouse is investigating using Advanced Perceptual Contrast Algorithm (APCA) which is now available in developer version of DevTools over old AA/AAA guidelines but it is not clear if it will solve all the issues.

APCA will be included in WCAG 3 according to [this tweet by Dan Hollick](https://twitter.com/danhollick/status/1468958644364402702) and beautifully it highlights that the "white on orange" is fine (even though it was failing in the old simple algorithm):

> ![image](https://user-images.githubusercontent.com/5832902/147785535-e3d2844a-bbd4-4976-b4e1-5d5d47e6e664.png)

The tweet highlights the that the orange button issue is really a failure of WCAG 2 and links to [Why the New Contrast Method APCA](https://github.com/Myndex/SAPC-APCA/blob/master/WhyAPCA.md) a document from WCAG 3 contrast author who clearly highlights the issues with WCAG 2 colour recommendations calling it:

> the single "most wrong" part of WCAG 2.x

which really well expresses my feeling about it

CC @isabela-pf

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.