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

Add support for High Contrast Theme #356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nchevobbe
Copy link

Buttons icon are now visible and uses system colors. Since external SVG images can't get dynamically styled, we're adding a pseudo element on buttons, mask it with the appropriate icon, and control the color of the icon through the element background image. This allows us to remove all the *-white.svg images as we can change the color with CSS.

We opt-out of forced colors for the elements where we want to apply non-system colors, i.e. the foreground, background and preview sections.


Before vs After

  1. Night Sky image
  2. Desert image
  3. Aquatic image
  4. Dusk image

@ungjinPark
Copy link
Contributor

ungjinPark commented Nov 27, 2024

I think accordion buttons (success criteria) also need to be improved for better usability in contrast mode.

When using CCAe without contrast mode, we can clearly see the clickable size and boundary of accordion buttons (success criteria) because each button is distinguished by a specific background color (e.g., black buttons in light mode, gray buttons in dark mode).

image

However, in contrast mode, users cannot distinguish the boundaries of each accordion button.

Microsoft addressed this issue by adding borders to buttons in contrast mode. What do you think about adopting a similar approach?

@nchevobbe
Copy link
Author

I think accordion buttons (success criteria) also need to be improved for better usability in contrast mode.

When using CCAe without contrast mode, we can clearly see the clickable size and boundary of accordion buttons (success criteria) because each button is distinguished by a specific background color (e.g., black buttons in light mode, gray buttons in dark mode).

image

However, in contrast mode, users cannot distinguish the boundaries of each accordion button.

Microsoft addressed this issue by adding borders to buttons in contrast mode. What do you think about adopting a similar approach?

Sure, I'll do that too :)

Buttons icon are now visible and uses system colors. Since external SVG images
can't get dynamically styled, we're adding a pseudo element on buttons, mask
it with the appropriate icon, and control the color of the icon through the
element background image.
This allows us to remove all the *-white.svg images as we can change the color with CSS.

We opt-out of forced colors for the elements where we want to apply non-system colors,
i.e. the foreground, background and preview sections.

detail/summary elements are adapted to look nice in High Contrast Theme.
@nchevobbe
Copy link
Author

Here it is with the details/summary adapting to High Contrast:
image
image

and in regular mode for reference:

image

Note that we could have a ButtonText background with a ButtonFace text if we want to be more visually consistent with what the regular UI looks like (light text on dark background)

@nchevobbe
Copy link
Author

Note that we could have a ButtonText background with a ButtonFace text if we want to be more visually consistent with what the regular UI looks like (light text on dark background)

what it would look like:

image
image

ungjinPark pushed a commit to ungjinPark/CCAe that referenced this pull request Nov 28, 2024
The contrast mode issue(ThePacielloGroup#355, ThePacielloGroup#356) prompted me to revisit the color contrast of the CCA user interface.

I identified issues with color contrast across various screen theme modes (e.g., Windows Contrast Theme, Dark Mode, Light Mode), particularly with the fail (X mark) and pass (check mark) icons.

To address this, I adjusted the colors to ensure a contrast ratio of at least 4.5:1 in all modes (Light, Dark, and Contrast Mode).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants