-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
a11y high contrast mode and focus state bug fixes for web components #28717
a11y high contrast mode and focus state bug fixes for web components #28717
Conversation
📊 Bundle size report🤖 This report was generated against 5e205bc242bef175275d73d3ca5c52243782f589 |
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 5e205bc242bef175275d73d3ca5c52243782f589 (build) |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 1533572:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good @brianchristopherbrady - one change I'd like to see is using the forcedColorsStylesheetBehavior
from fast-foundation which allows the stylesheets to be conditionally applied only in forced colors scenarios.
:host([aria-pressed='false'][appearance='transparent']) .control { | ||
border-color: ActiveBorder; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest we use the forcedColorsStylesheetBehavior()
for these which are exported from @microsoft/fast-foundation
. This would only load the styles when forced colors is active which will save slightly on parsing stylesheets when it's not.
:host([aria-pressed='false'][appearance='outline']) .control, | ||
:host([aria-pressed='false'][appearance='transparent']) .control, | ||
:host([aria-pressed='false'][appearance='transparent']) .control { | ||
border-color: ActiveBorder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
active border on pressed
being falsed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops
…ColorsStylesheetBehavior
:host([aria-checked='false']:active) .control, | ||
:host([aria-checked='false']:hover) .control { | ||
border-color: ActiveBorder; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another instance where it's odd for active border to be on the non checked.
:host([aria-checked='true']:active) .switch { | ||
background: Highlight; | ||
border-color: Highlight; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all of these can be a single selector can they not?
} | ||
:host(:active) .checked-indicator { | ||
background-color: ActiveCaption; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likewise can these also be a single selector? Let's look for duplication like this elsewhere and fix as well please :)
} | ||
:host(:hover) .control { | ||
border-color: Highlight; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine with the first block which shares the same styles
…b.com/brianchristopherbrady/fluentui-fork into user/brianbrady/a11yHighContrastFixes
Approving this - though we may have follow-ups once the trusted test team validates. |
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…icrosoft#28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…icrosoft#28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…icrosoft#28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
…28717) * radio init * styles radio * reverts branch * input spec init * cleans up spec * formatting * updates component name to text input * updates component name in spec * high contrast mode color fixes * removes file * yarn change * high contrast visual fixes * high contrast a11y fixes: optimizes high contrast styles using forcedColorsStylesheetBehavior * hc a11y: addresses feedback * hc a11y: removes dead code * hc a11y: fixes radio colors * hc a11y: fixes switch, togglebutton styles * hc a11y: combines css selectors * hc a11y: updates button styles * hc a11y: updates toggle button styles * hc a11y: fixes button styles --------- Co-authored-by: Chris Holt <chhol@microsoft.com>
This pull request addresses several accessibility issues related to the visibility of components in Windows high contrast modes. The following fixes have been implemented:
Examples:
Slider before:
Slider after:
Divider before:
Divider after:
Tabs before:
Tabs after:
By specifying appropriate Windows system colors for these components, they are now displaying correctly and meeting the contrast requirements in Windows high contrast mode. These improvements enhance the accessibility of the application for users with accessibility needs, ensuring a more inclusive user experience.