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

a11y high contrast mode and focus state bug fixes for web components #28717

Conversation

brianchristopherbrady
Copy link
Contributor

@brianchristopherbrady brianchristopherbrady commented Aug 3, 2023

This pull request addresses several accessibility issues related to the visibility of components in Windows high contrast modes. The following fixes have been implemented:

  • Fixed the issue where the accordion item icon was not visible in Windows high contrast mode.
  • Resolved the problem with the divider component being invisible in Windows high contrast mode.
  • Implemented a visible pressed state for the toggle button in Windows high contrast mode.
  • Ensured the progress bar is now visible in Windows high contrast mode.
  • Fixed the slider component to be visible in Windows high contrast mode.
  • Improved the visibility of the tab active indicator in Windows high contrast mode.
  • Added focus state to Switch

Examples:
Slider before:
image

Slider after:
image

Divider before:
image

Divider after:
image

Tabs before:
image

Tabs after:
image

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.

@brianchristopherbrady brianchristopherbrady requested a review from a team as a code owner August 3, 2023 01:29
@fabricteam
Copy link
Collaborator

fabricteam commented Aug 3, 2023

📊 Bundle size report

🤖 This report was generated against 5e205bc242bef175275d73d3ca5c52243782f589

@size-auditor
Copy link

size-auditor bot commented Aug 3, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 5e205bc242bef175275d73d3ca5c52243782f589 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 3, 2023

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:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@brianchristopherbrady brianchristopherbrady changed the title a11y high contrast mode bug fixes for web components a11y high contrast mode and focus state bug fixes for web components Aug 4, 2023
Copy link
Member

@chrisdholt chrisdholt left a 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;
}
}
Copy link
Member

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;
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops

:host([aria-checked='false']:active) .control,
:host([aria-checked='false']:hover) .control {
border-color: ActiveBorder;
}
Copy link
Member

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;
}
Copy link
Member

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;
}
Copy link
Member

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;
}
Copy link
Member

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

@chrisdholt
Copy link
Member

Approving this - though we may have follow-ups once the trusted test team validates.

@chrisdholt chrisdholt merged commit 54df8d3 into microsoft:web-components-v3 Aug 8, 2023
20 checks passed
chrisdholt added a commit that referenced this pull request Apr 29, 2024
…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>
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
…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>
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
…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>
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 30, 2024
…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>
radium-v pushed a commit that referenced this pull request Apr 30, 2024
…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>
radium-v pushed a commit that referenced this pull request May 2, 2024
…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>
radium-v pushed a commit that referenced this pull request May 2, 2024
…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>
radium-v pushed a commit that referenced this pull request May 2, 2024
…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>
radium-v pushed a commit that referenced this pull request May 3, 2024
…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>
radium-v pushed a commit that referenced this pull request May 6, 2024
…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>
radium-v pushed a commit that referenced this pull request May 6, 2024
…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>
radium-v pushed a commit that referenced this pull request May 8, 2024
…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>
radium-v pushed a commit that referenced this pull request May 10, 2024
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants