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

fix(HCM): update Firefox HCM focus styles #7314

Merged
merged 3 commits into from Nov 20, 2020

Conversation

tw15egan
Copy link
Member

@tw15egan tw15egan commented Nov 18, 2020

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 the focus-outline mixin that will set the border/outline to be dotted 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

  • Component specific media queries to alleviate any HCM issues in both Firefox and Edge

Changed

  • focus-outline mixin now has a media query that only targets users on Windows 10 using Firefox with prefers-contrast to be enabled

Removed

  • Extraneous HCM media queries

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, type about:config in the address bar, search for layout.css.prefers-contrast, and set this to true

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 👍

@netlify
Copy link

netlify bot commented Nov 18, 2020

Deploy preview for carbon-elements ready!

Built with commit 230ee8d

https://deploy-preview-7314--carbon-elements.netlify.app

@netlify
Copy link

netlify bot commented Nov 18, 2020

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
Copy link
Member Author

@kinueng This link has pending changes with this PR. Let me know if this fixes most of the issues you've been seeing in Firefox HCM 👍

@joshblack
Copy link
Contributor

@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 👀

Copy link
Contributor

@dakahn dakahn left a 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.

@tw15egan
Copy link
Member Author

@joshblack yeah definitely!

@kodiakhq kodiakhq bot merged commit ab61506 into carbon-design-system:master Nov 20, 2020
@tw15egan tw15egan deleted the firefox-hcm-updates branch April 28, 2021 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants