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

Two bug-fixes for forced-color mode #2443

Merged

Conversation

SebinSong
Copy link
Collaborator

@SebinSong SebinSong commented Dec 1, 2024

closes #2385
closes #2440

[Fix 1]



[Fix 2]

@SebinSong SebinSong self-assigned this Dec 1, 2024
Copy link

cypress bot commented Dec 1, 2024

group-income    Run #3493

Run Properties:  status check passed Passed #3493  •  git commit 88915fd1ff ℹ️: Merge 013f37796f5caceabebd8983a0050bf43f70ed4a into 5f68446576179fd93a5428ebfba3...
Project group-income
Branch Review sebin/task/#2385-image-viewer-in-forced-color-mode
Run status status check passed Passed #3493
Run duration 08m 50s
Commit git commit 88915fd1ff ℹ️: Merge 013f37796f5caceabebd8983a0050bf43f70ed4a into 5f68446576179fd93a5428ebfba3...
Committer Sebin Song
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 10
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 111
View all changes introduced in this branch ↗︎

@corrideat
Copy link
Member

This looks good, but I have an issue with this part:

I observed most elements that involve user interactions are rendered with white color when 'forced-color' mode is turned on. So made fixes using $white sass variable we have in the source-code.

That's not entirely accurate. See https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors. In particular (emphasis mine):

Note: User agents choose system colors based on native element semantics, not on added ARIA roles. As an example, adding role="button" to a div will not cause an element's color to be forced to ButtonText

There are two cases where the user agent does not force the values for the above properties — when a forced-color-adjust value of none is applied to an element, or when a system color is specified by the author.

So, instead of using $white or any arbitrary colour, I'd use a system colour instead.

@SebinSong
Copy link
Collaborator Author

@corrideat Those articles are informative actually. Updated the $white to system-color.

Copy link
Member

@taoeffect taoeffect left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done @SebinSong!

@taoeffect taoeffect requested a review from corrideat December 3, 2024 03:12
@taoeffect taoeffect merged commit 6ad6149 into master Dec 3, 2024
4 checks passed
@taoeffect taoeffect deleted the sebin/task/#2385-image-viewer-in-forced-color-mode branch December 3, 2024 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants