mdn / yari

The platform code behind MDN Web Docs
Mozilla Public License 2.0
1.19k stars 508 forks source link

Bug: Color differentiation of the code syntax for people who has color vision deficiency #5423

Open applegz opened 2 years ago

applegz commented 2 years ago

Summary

The color in code snippets might create difficulties for people who are colorblind to tell the difference, especially in the dark mode.

Where did you spot the bug?

I first notice on this page in dark mode, I believe it's the same on every page that has code snippets.

What is the problem?

Current code snippet color with regular rendering in dark mode: Screen Shot 2022-03-02 at 12 04 37 PM Current code snippet color in emulator with deuteranopia vision deficiency in dark mode: Screen Shot 2022-03-02 at 12 04 51 PM

It's also an issue not in the dark mode: Screen Shot 2022-03-02 at 12 12 11 PM Screen Shot 2022-03-02 at 12 12 23 PM

What did you expect to happen?

Everyone should be able to tell the code syntax by just looking at the color. It should be accessible for anybody.

Steps to reproduce the issue

  1. Open any Mozilla website that has code snippet in Chrome
  2. Open the console
  3. Click ... to open more menu
  4. Click more tools
  5. Select rendering
  6. Find emulate vision deficiencies
  7. Select different options to see what people might see if they have color vision deficiency

Environment

Device

Browser

Operating system

Screenshots

schalkneethling commented 2 years ago

Thank you for reporting @applegz. I am doing a larger investigation into our use of color to ensure we not only meet AA for contrast against the background but, that the color contrast between surrounding content is also appropriate.