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

High contrast mode not working with diagram SVG #635

Open
robertfoobar opened this issue Apr 27, 2022 · 6 comments
Open

High contrast mode not working with diagram SVG #635

robertfoobar opened this issue Apr 27, 2022 · 6 comments
Labels
a11y backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day

Comments

@robertfoobar
Copy link

Describe the Bug

Visually impaired users, who use e.g. Windows high contrast mode, cannot properly perceive diagram representations in the browser.

Steps to Reproduce

  1. Create a diagram using bpmn.io inside the browser
  2. Activate Windows high contrast mode

Expected Behavior

Colors of the diagrams SVG elements (arrows, outlines of elements, text) should be inverted. They also should respect the user selected high contrast color scheme. Instead what you observe is that the diagram remains in it's default colors.

Default contrast settings:
image
Expected high contrast look with black high contrast color scheme:
image
Actual high contrast look with black high contrast color scheme:
image

Environment

@robertfoobar robertfoobar added the bug Something isn't working label Apr 27, 2022
@robertfoobar
Copy link
Author

As a workaround for the black high contrast mode we've added a css media query:

@media (forced-colors: active) {
  g.viewport {
    filter: invert(1);
  }
}

However, for other color schemes, I don't know how this can be worked around. Maybe using currentColor for stroke and fill, see https://melanie-richards.com/blog/currentcolor-svg-hcm/

@smbea smbea added the a11y label Apr 28, 2022
@smbea
Copy link
Contributor

smbea commented Apr 28, 2022

@nikku
Copy link
Member

nikku commented Apr 28, 2022

@smbea Let us investigate if this is a quick fix we can adopt, and if so, adopt it.

@nikku nikku added the spring cleaning Could be cleaned up one day label Apr 28, 2022
@nikku
Copy link
Member

nikku commented Apr 28, 2022

Marked as a spring cleaning topic.

@smbea
Copy link
Contributor

smbea commented Apr 29, 2022

On Mac, there is a "high-contrast" and "invert colours" mode. With the later, the desired behaviour is achieved:
Screenshot 2022-04-29 at 14 34 19

Keep in mind, this also inverts the color, so the blue fill would become orange, which I believe would be the outcome of what you implemented with forced-colors: active.

Screenshot 2022-04-29 at 14 26 47

@smbea
Copy link
Contributor

smbea commented Apr 29, 2022

I believe we can use your suggestion to make this better for Windows users, so I'm moving this to backlog for now.

@smbea smbea added the backlog Queued in backlog label Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a11y backlog Queued in backlog bug Something isn't working spring cleaning Could be cleaned up one day
Projects
None yet
Development

No branches or pull requests

3 participants