fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Office UI Fabric site does not work well in High contrast

Open jgage176 opened this issue 7 years ago • 4 comments

Switching to high contrast (I used the black one) the site had many accessibility issues, failing MS accessibility standards. Here are some of them I have seen and captured:

  1. Pictures on left navigation for iOS and Android do not have enough color contrast:

image

  1. Active and focus buttons on navigation have background and font color as black:

image

  1. When moving around to select a component from a menu on the left the focus is invisible:

image

Notice how the link at the bottom shows what I am currently selecting but there is no indication visually what I have selected.

  1. On the individual component pages they have color contrast issues as well: Both the active and the focus have font color and background

image

  1. The button color is white and the font color is white

image

jgage176 avatar Oct 23 '19 19:10 jgage176

Thanks for the report. Will dig into this this week.

jdhuntington avatar Oct 23 '19 20:10 jdhuntington

@jdhuntington Getting rid of the background gradient in high contrast might help fix some of these issues, and is something we should do regardless. The change is as follows (and you should probably do the same in example-app-base _base.scss)--the important part is the @include high-contrast.

diff --git a/apps/fabric-website/src/styles/_base.scss b/apps/fabric-website/src/styles/_base.scss
index 7e99df4ef..eeeeed78d 100644
--- a/apps/fabric-website/src/styles/_base.scss
+++ b/apps/fabric-website/src/styles/_base.scss
@@ -6,15 +6,21 @@
   html, body {
     -webkit-font-smoothing: antialiased;
     -webkit-tap-highlight-color: transparent;
-    background: $ms-color-gray10; // Match header/footer color for browsers with momentum scroll
+    // Match header/footer color for browsers with momentum scroll
+    background: $ms-color-gray10;
+    // Used to give the nav a white background and the body a gray background
     background: linear-gradient(to right, $ms-color-white 0%, $ms-color-white 50%, $ms-color-gray10 50%, $ms-color-gray10 100%);
     height: 100%;
     margin: 0;
     padding: 0;
     width: 100%;
+
+    @include high-contrast {
+      // The gradient doesn't behave well in high contrast, so get rid of it.
+      background: WindowBackground;
+    }
   }
 
-  // Border box everywhere
   html {
     box-sizing: border-box;
   }

ecraig12345 avatar Nov 01 '19 19:11 ecraig12345

some of these issues tracked at #10911

jdhuntington avatar Nov 01 '19 21:11 jdhuntington

:tada:This issue was addressed in #11089, which has now been successfully released as @uifabric/[email protected].:tada:

Handy links:

msft-github-bot avatar Nov 13 '19 12:11 msft-github-bot