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(a11y): fixing UI shell windows high contrast mode accessibility #6950

Merged
merged 2 commits into from
Oct 2, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions packages/components/src/components/ui-shell/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
.#{$prefix}--header__action:focus {
border-color: $shell-header-focus;
outline: none;

// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
outline: 3px solid transparent;
outline-offset: -3px;
}
}

.#{$prefix}--header__action:active {
Expand Down Expand Up @@ -198,6 +205,13 @@
color: $shell-header-text-01;
border-color: $shell-header-focus;
outline: none;

// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
outline: 3px solid transparent;
outline-offset: -3px;
}
}

a.#{$prefix}--header__menu-item:hover > svg,
Expand Down
27 changes: 27 additions & 0 deletions packages/components/src/components/ui-shell/_side-nav.scss
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,13 @@

.#{$prefix}--side-nav__submenu:focus {
@include focus-outline('outline');

// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
outline: 3px solid transparent;
outline-offset: -3px;
}
}

.#{$prefix}--side-nav__submenu-title {
Expand Down Expand Up @@ -508,6 +515,13 @@
a.#{$prefix}--side-nav__link:focus,
.#{$prefix}--side-nav a.#{$prefix}--header__menu-item:focus {
@include focus-outline('outline');

// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
outline: 3px solid transparent;
outline-offset: -3px;
}
}

a.#{$prefix}--side-nav__link[aria-current='page'],
Expand Down Expand Up @@ -553,6 +567,12 @@
width: mini-units(2);
height: mini-units(2);
fill: $shell-side-nav-icon-01;

@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
// `ButtonText` is a CSS2 system color to help improve colors in HCM
fill: ButtonText;
}
}

.#{$prefix}--side-nav__icon > svg.#{$prefix}--side-nav-collapse-icon {
Expand Down Expand Up @@ -665,6 +685,13 @@
.#{$prefix}--header__menu-arrow,
.#{$prefix}--side-nav .#{$prefix}--header__menu-arrow {
fill: $shell-side-nav-text-01;

// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active),
screen and (prefers-contrast) {
// `ButtonText` is a CSS2 system color to help improve colors in HCM
fill: ButtonText;
}
}
}

Expand Down