Skip to content

Commit

Permalink
fix(a11y): tooltip HCM fix (#7031)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
rjhenriquez and kodiakhq[bot] committed Oct 21, 2020
1 parent dc6b07d commit 54d9079
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 21 additions & 0 deletions packages/components/src/components/tooltip/_tooltip.scss
Expand Up @@ -334,6 +334,13 @@

.#{$prefix}--tooltip__trigger svg {
fill: $icon-02;

// 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;
}
}

.#{$prefix}--tooltip__trigger:not(.#{$prefix}--btn--icon-only) {
Expand Down Expand Up @@ -376,6 +383,13 @@
background: $inverse-02;
border-radius: rem(2px);

// 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
border: 1px solid transparent;
}

// @todo this can be deprecated in v11 since focus should always be on the content container not the tooltip
&:focus {
outline: 0;
Expand Down Expand Up @@ -554,6 +568,13 @@
&:focus {
svg {
fill: $icon-02;

// 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
5 changes: 2 additions & 3 deletions packages/components/src/globals/scss/_tooltip.scss
Expand Up @@ -60,9 +60,8 @@
width: auto;
}

// Windows HCM Fix
@media screen and (-ms-high-contrast: active) {
// `GrayText` is a CSS2 system color to help improve colors in HCM
// Windows, Firefox HCM Fix
@media screen and (-ms-high-contrast: active), screen and (prefers-contrast) {
border: 1px solid transparent;
}
}
Expand Down

0 comments on commit 54d9079

Please sign in to comment.