-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
ToggleGroupControl: Fix focus and selected style to support Windows High Contrast mode #50785
Conversation
@@ -80,6 +82,9 @@ export const BackdropView = styled.div` | |||
transition: transform ${ CONFIG.transitionDurationFast } ease; | |||
${ reduceMotion( 'transition' ) } | |||
z-index: 1; | |||
// Windows High Contrast mode will show this outline, but not the box-shadow. | |||
outline: 2px solid transparent; | |||
outline-offset: -3px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flaky tests detected in 9b38391. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/5024609294
|
This looks great - thanks @t-hamano! The -3px offset seems good to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Fixes: #50782
Similar to #50772
What?
This PR displays the focus outline and selected outline in ToggleGroupControl when Windows is in high contrast mode.
Why?
Windows high contrast mode does not show box-shadow when focused. In addition, which button is selected or not is not visible in high contrast mode because it is represented only by the background color.
How?
I have added a transparent outline as a focus style. I added a similar transparent outline for which button is selected or not, because the background color is not available.
Screenshots or screencast
screencast.mp4