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

a11y: Ensure all themes for all diagrams pass WCAG contrast AA checks including dark mode #3691

Open
10 tasks
weedySeaDragon opened this issue Oct 17, 2022 · 4 comments
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@weedySeaDragon
Copy link
Contributor

Describe the bug
Based on the comment made by @aardrian in #2732:
There are some themes and diagrams that fail WCAG contrast checks:

We need to ensure that all diagrams using _all_themes in both light (normal) and dark mode pass the minimal (AA) WCAG contrast checks.

There are tools that make checking this easy including Firefox dev tools (Accessibility section) and Chrome dev tools (Elements -> Accessibility).

It may make sense to split this up to a few smaller PRs -- perhaps 1 for each theme. It's likely that if there is a contrast problem, it is caused by the colors in a theme. Although it may be that some diagrams alter (e.g. lighten or darken) colors.

Need to check and fix all 12 diagrams for these themes:

  • base
  • base (dark mode)
  • default
  • default (dark mode)
  • dark
  • dark (dark mode)
  • forest
  • forest (dark mode)
  • neutral
  • neutral (dark mode)

"all 12 diagrams" = c4, class, ER, flowchart, gantt, git, info, pie, requirement, sequence, state

Refs:
https://www.w3.org/TR/WCAG21/#contrast-minimum
https://www.w3.org/TR/WCAG21/#non-text-contrast

https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_WCAG/Perceivable/Color_contrast

@weedySeaDragon weedySeaDragon added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Oct 17, 2022
@sobitp59
Copy link

Hey! I would love to do this. Can you please assign me this?

@sidharthv96
Copy link
Member

Hi @sobitp59, you don't have to ask for issues to be assigned.

All issues without Open PRs are up for everyone. :)

@brennanyoung
Copy link

Guidance note: If more than one color scheme is available to end users, only one of them needs to be compliant with these color/contrast SCs, as long as users can perceive the switch back from the non-compliant version.

Ideally, "all" of the color schemes will be compliant, but in practice there can be some contradictory requirements in this space, where some users find very high contrast difficult to use, and prefer low contrast. Human vision is very diverse.

Also WCAG level AAA has even stricter requirements about contrast. Would be good to have a couple of those too.

How about offering a few color schemes that are WCAG level A/AA compliant, maybe a couple that are AAA compliant?

In the worst case, any that don't get "fixed" can remain as long as the compliance levels are clearly indicated.

Is there an obvious way to indicate these compliance levels? Docs?

@brennanyoung
Copy link

FYI Windows High Contrast Mode (often "HCM") is a very popular assistive tech that converts the display into a high-contrast version at the host-system level. I am mentioning it here because HCM is likely to come up in this context.

HCM works ok, but there are often problems displaying content that has no stroke/border. CSS background images used as "real" content are also unlikely to display in HCM. Hardware accelerated video also fails to appear on some browsers.

WCAG does not require compatibility with Windows High Contrast Mode but to be a good citizen, make sure anything important (i.e. meaningful charting elements) has a non-null border/stroke width.

A transparent color value for border/stroke will not be visible until HCM is enabled, after which the border/stroke will be drawn in the foreground color.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

4 participants