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
fix(HCM): update Firefox HCM focus styles #7314
fix(HCM): update Firefox HCM focus styles #7314
Conversation
Deploy preview for carbon-elements ready! Built with commit 230ee8d |
Deploy preview for carbon-components-react ready! Built without sensitive environment variables with commit 230ee8d https://deploy-preview-7314--carbon-components-react.netlify.app |
@tw15egan thanks for doing this! After the break, do you think you would have any time to talk about all the HCM fixes that are being done and explain what the process has been like? I feel like all of us could benefit from better understanding this stuff 👀 |
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.
Awesome! Hopefully Firefox recognizes system colors soon.
@joshblack yeah definitely! |
Closes #7313
Closes #7301
This is a quick and dirty fix for the lack of focus state support in HCM when using Firefox. After some debugging with DA, it seems like Firefox's
prefers-contrast
overrides any type of custom colors when in HCM. Because of this, we were not seeing the same blue outline we would see on Windows Edge in HCM. To remedy this, I added media queries to thefocus-outline
mixin that will set the border/outline to bedotted
instead of solid, which will offer some affordance to the user when using a keyboard to navigate. Not a perfect solution, but until there is a better fix on the Firefox end, at least you will be able to tell which item currently has keyboard focus.Changelog
New
Changed
focus-outline
mixin now has a media query that only targets users on Windows 10 using Firefox withprefers-contrast
to be enabledRemoved
Testing / Reviewing
To test these changes, you'll need a Windows 10 machine and High Contrast Mode enabled (
Settings --> Ease of Access --> High Contrast Mode
)To enable
prefers-contrast
in Firefox, typeabout:config
in the address bar, search forlayout.css.prefers-contrast
, and set this totrue
Verify focus is visible throughout the React Storybook for any component that is expected to receive focus.
@dakahn I went through each component in both Firefox and Edge, so this should address all outstanding HCM issues. Let me know if I missed any of them 👍