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(checkbox): checked state forced color contrast #1699

Merged
merged 4 commits into from
Apr 4, 2024

Conversation

dancormier
Copy link
Contributor

STACKS-599


This PR fixes the lack of contrast in the checked checkbox component when the user has enabled forced color mode.

Before

stackoverflow design_product_components_checkbox_

After

localhost_8080_product_components_checkbox_

@dancormier dancormier added bug A reproducible problem with the Stacks code accessibility labels Apr 3, 2024
@dancormier dancormier requested a review from giamir April 3, 2024 15:20
Copy link

netlify bot commented Apr 3, 2024

Deploy Preview for stacks ready!

Name Link
🔨 Latest commit ba315d9
🔍 Latest deploy log https://app.netlify.com/sites/stacks/deploys/660edc50045a6800084232ab
😎 Deploy Preview https://deploy-preview-1699--stacks.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

@giamir giamir left a comment

Choose a reason for hiding this comment

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

Based on my testing in WHCM (Desert mode) we can achieve what we want without having to redefine the bg-image
This is sufficient:

   @media (forced-colors: active) {
        &:checked {
            --_ch-bg: ButtonText !important;
        }
        &:indeterminate {
            --_ch-bg: ButtonText !important;
        }
    }

I am happy to merge the simplified version above in.

Sidenote
While I was in Windows I took some time to explore our DS in WHCM and I could see several components that are not rendering well (including toggles, tags, navigation not showing selected items, etc...). We should probably create a rough inventory of those issues as part of the upcoming spike story.

@dancormier
Copy link
Contributor Author

Based on my testing in WHCM (Desert mode) we can achieve what we want without having to redefine the bg-image This is sufficient:

   @media (forced-colors: active) {
        &:checked {
            --_ch-bg: ButtonText !important;
        }
        &:indeterminate {
            --_ch-bg: ButtonText !important;
        }
    }

I am happy to merge the simplified version above in.

Without the background image redefinition, we'll have contrast issues if Stacks dark mode is enabled in addition to forced color mode.

image

I understand this would be an unusual circumstance but I figured it was a good idea to account for all possible cases. What do you think @giamir?

Sidenote While I was in Windows I took some time to explore our DS in WHCM and I could see several components that are not rendering well (including toggles, tags, navigation not showing selected items, etc...). We should probably create a rough inventory of those issues as part of the upcoming spike story.

Yep, there's definitely room for improvement across our components. The ticket has "A rough inventory of user forced color issues in our components (e.g. toggles, tags, etc…) is added to the document" in the success criteria so I'll make sure to include a list of components (assuming I perform the spike sprint).

@dancormier dancormier merged commit 5c04613 into develop Apr 4, 2024
11 checks passed
@dancormier dancormier deleted the STACKS-599/checkbox-forced-color branch April 4, 2024 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility bug A reproducible problem with the Stacks code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants