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

[a11y] Issue with Button and Link outlines on Windows 11 high contrast themes #846

Open
stamat opened this issue Dec 2, 2024 · 1 comment
Labels
brand bug Something isn't working

Comments

@stamat
Copy link
Contributor

stamat commented Dec 2, 2024

1. Issue with the Button component outline in high contrast themes

For some reason there is this code, that draws the outline if @media (forced-colors: active). So on focus, the outline doesn't change, it's always visible.

/* Retains focus indicator when in "Windows High Contrast Mode". */
.Button:focus:not(.Button--disabled[disabled]) {
outline: var(--brand-borderWidth-thick) solid;
outline-color: var(--brand-color-focus);
outline-offset: 2px;
}

This caused the issue 👇 to be reported:

2. Issue with the Link component outline in high contrast themes

Link has the native outline disabled and box-shadow used as the outline for some reason unknown to me. In @media (forced-colors: active) all of the box-shadows are removed and all of the backgrounds are set to the same color.

.Link:focus:focus-visible {
outline: none;
box-shadow: 0 0 0 2px var(--brand-color-canvas-default), 0 0 2px 5px var(--brand-color-focus);
transition: none;
}

Also Link needs the outline-offset set to 2px

It's just something I picked up along the way.

All high contrast issues are Sev 4 - so it's not a hurry on this. But could be cool for this to be sorted out and be consistent. 😘

@stamat
Copy link
Contributor Author

stamat commented Dec 2, 2024

@rezrah @joshfarrant bros, I've made the update here, tested it out in the high contrast themes, it works now 💖 . Kinda need this in the new update 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brand bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant