Skip to content

Commit

Permalink
fix(a11y): fixing UI shell windows high contrast mode accessibility (#…
Browse files Browse the repository at this point in the history
…6950)

Co-authored-by: Ricardo Henriquez <[email protected]>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Oct 2, 2020
1 parent c5a64d2 commit bfe5ac2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
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

0 comments on commit bfe5ac2

Please sign in to comment.