Skip to content

feat(HCM): add HCM mixin, use forced-colors #8489

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

Merged
merged 12 commits into from
May 3, 2021

Conversation

tw15egan
Copy link
Contributor

@tw15egan tw15egan commented Apr 22, 2021

Closes #8413
Closes #8458

Updates the HCM media queries around the codebase to use a mixin, and moves the HCM to the bottom of the .scss files to ensure they are not overwritten.

Also uses forced-colors which is fully supported in Chrome 🎉

Changelog

New

  • @mixin high-contrast-mode which has a few built-in styles to handle various HCM fixes. This mixin makes it easier to update the underlying media query used for HCM.
  • added forced-colors support, which is supported in Chrome, Edge, Safari (opt-in), and Firefox (opt-in).

Changed

  • Moved HCM queries to the end of the file so that other styles do not override them

Removed

  • Media queries throughout the repo for HCM have been removed, and replaced with the HCM mixin at the bottom of .scss files

Testing / Reviewing

In Windows, enable High Contrast Mode, and open up Firefox, Chrome, and Edge. In Firefox, you will need to type about:config in the address bar, then search for forced-colors and set that to true. Then, ensure each component is usable when in HCM and that all icons are displayed.

@netlify
Copy link

netlify bot commented Apr 22, 2021

Deploy preview for carbon-elements ready!

Built with commit ff418f4

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

@netlify
Copy link

netlify bot commented Apr 22, 2021

Deploy preview for carbon-components-react ready!

Built without sensitive environment variables with commit ff418f4

https://deploy-preview-8489--carbon-components-react.netlify.app

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me

@tw15egan
Copy link
Contributor Author

@dakahn added in the rest if you want to take a look and confirm 👍🏻

@tw15egan tw15egan requested a review from a team April 29, 2021 21:45
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.

Looks awesome. Sorry for the review delay 👍🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Accessibility:The 3 dots icons are invisible when Windows high contrast mode is active. Support high contrast mode in chrome without a plugin
3 participants