A11Y: Improve accessibility in WHCM themes (#18606)

This commit is contained in:
Keegan George 2022-10-17 07:07:46 -07:00 committed by GitHub
parent f5419521f0
commit 4b4dbbf580
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 0 deletions

View File

@ -4,6 +4,7 @@
@import "vendor/pikaday"; @import "vendor/pikaday";
@import "vendor/tippy"; @import "vendor/tippy";
@import "vendor/svg-arrow"; @import "vendor/svg-arrow";
@import "common/whcm";
@import "common/foundation/helpers"; @import "common/foundation/helpers";
@import "common/foundation/base"; @import "common/foundation/base";
@import "common/select-kit/_index"; @import "common/select-kit/_index";

View File

@ -163,6 +163,7 @@
padding-top: 0.25em; padding-top: 0.25em;
padding-bottom: 0.25em; padding-bottom: 0.25em;
&:focus-visible { &:focus-visible {
outline: 2px solid transparent;
background-color: var(--tertiary-very-low); background-color: var(--tertiary-very-low);
} }
} }

View File

@ -27,6 +27,10 @@
color: $icon-color; color: $icon-color;
margin-right: 0.45em; margin-right: 0.45em;
transition: color 0.25s; transition: color 0.25s;
// For Windows High Contrast (see whcm.scss for more)
@media (forced-colors: active) {
color: ButtonText;
}
} }
.d-button-label + .d-icon { .d-button-label + .d-icon {
margin-left: 0.45em; margin-left: 0.45em;
@ -42,6 +46,10 @@
color: $hover-text-color; color: $hover-text-color;
.d-icon { .d-icon {
color: $hover-icon-color; color: $hover-icon-color;
// For Windows High Contrast (see whcm.scss for more)
@media (forced-colors: active) {
color: Highlight;
}
} }
} }
&:focus { &:focus {
@ -50,6 +58,9 @@
color: $hover-text-color; color: $hover-text-color;
.d-icon { .d-icon {
color: $hover-icon-color; color: $hover-icon-color;
@media (forced-colors: active) {
color: Highlight;
}
} }
} }
&[href] { &[href] {

View File

@ -0,0 +1,21 @@
// Overrides for Windows High Contrast Mode
/*
Some @media (forced-colors: active) {} styles
have also been used inside mixins in:
- common/components/buttons.scss
See file above for overrides.
*/
// Select Kit
.select-kit {
.select-kit-row {
&:hover,
&:focus {
@media (forced-colors: active) {
outline: 2px auto transparent;
}
}
}
}