-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[a11y] ContentSwitcher - High Contrast Mode #19336
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
base: main
Are you sure you want to change the base?
[a11y] ContentSwitcher - High Contrast Mode #19336
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #19336 +/- ##
=======================================
Coverage 84.85% 84.85%
=======================================
Files 371 371
Lines 14413 14413
Branches 4694 4716 +22
=======================================
Hits 12230 12230
+ Misses 2037 2036 -1
- Partials 146 147 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
FYI, looks like we were working on the invisible icon problem in parallel, although attached to different ticket numbers. I think I have a fix in #19352 that eliminates the need for these mixin calls in general: @include high-contrast-mode('icon-fill');
@include high-contrast-mode('icon-fill-selected') I am curious if this part of your PR actually worked for you: @if ($type == 'selected') {
background-color: SelectedItem;
} I ask because I thought that |
Cool 😎 (I will take a look into that PR). @wkeese Should I wait for your PR to be merged before merging mine (in case mine gets approved)?
I am on Mac and when forced-colors is enabled, I get: ![]() |
I think that makes sense, then you can remove the parts setting icon-fill.
Oh you're right, although it's complicated. According to my tests on Windows 11 (in high contrast), a normal background color like this is ignored: @media screen and (-ms-high-contrast: active), (forced-colors: active) {
.cds--content-switcher-btn::after {
background-color: red;
}
} But when you set it to one of the high-contrast colors (like as done in your PR), it works: @media screen and (-ms-high-contrast: active), (forced-colors: active) {
.cds--content-switcher-btn::after {
background-color: SelectedItem;
}
} PS: I added this to my PR so I think you can get rid of the // Force a background-color for selected buttons etc., otherwise the user won't know they are selected.
@include custom-property.declaration('background-selected', SelectedItem);
@include custom-property.declaration(
'background-selected-hover',
SelectedItem
);
@include custom-property.declaration(
'layer-selected-inverse',
SelectedItem
); |
- fix hcm style for ContentSwitcher Contributes-to: carbon-design-system#19140 Signed-off-by: Mariya George [email protected]
- highlight selected tab Contributes-to: carbon-design-system#19140 Signed-off-by: Mariya George [email protected]
9ac55f1
to
de042e7
Compare
@mariyageorge01 thanks for your PR - this looks good, just some conflicts that needs attention |
Closes #19140
Fixed the ContentSwitcher Windows High Contrast mode style issues.
Changelog
New
Changed
Removed
Testing / Reviewing
PR Checklist
As the author of this PR, before marking ready for review, confirm you:
More details can be found in the pull request guide