angular / angular/components

bug(mat-button-toggle-group): Accessibility issue of WCAG non-text contrast and WCAG use of color

オープン
#27,748 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
area: material/button-toggle P3
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

This component fails color contrast in its selected state, and also fails the requirement that color should not be the only visual indicator to convey that an item is in a selected state.

This issue is applicable specifically to mat-button-toggle-group where multiple options are exposed. Single toggle button instances are meeting accessibility requirements because they have a change in text or icon in addition to color.

See WCAG context below:

WCAG [Non-text contrast](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast): “This success criterion does not require that controls have a visual boundary indicating the hit area, but if the visual indicator of the control is the only way to identify the control, then that indicator must have sufficient contrast.”
This success criterion is met, but is only applicable to the default (un-selected) state.

WCAG [Non-text contrast](https://www.w3.org/WAI/WCAG21/Understanding/non-text-contrast): Also, any visual information necessary to indicate state, such as whether a component is selected or focused must also ensure that the information used to identify the control in that state has a minimum 3:1 contrast ratio.
This is not being met.

WCAG [Use of color](https://www.w3.org/WAI/WCAG21/Understanding/use-of-color): If content is conveyed through the use of colors that differ not only in their hue, but that also have a significant difference in lightness, then this counts as an additional visual distinction, as long as the difference in relative luminance between the colors leads to a contrast ratio of 3:1 or greater.
This implies that a design solution that meets 3:1 contrast is sufficient in meeting the “Use of Color” success criterion.

### Reproduction

This issue can be reproduced in the component demo and does not require StackBlitz: https://material.angular.io/components/button-toggle/overview

### Expected Behavior

The contrast ratio of the selected state must meet at least 3:1 to fulfill WCAG success criterion for non-text contrast and use of color.

### Actual Behavior

Currently the selected state of mat-button-toggle-group uses a fill color of #E0E0E0. On an #FFFFFF background, the contrast ratio is only 1.32:1.

### Environment

Angular/Material 16.2.1

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

https://material.angular.io/components/button-toggle/overview の mat-button-toggle-group コンポーネントのデモから始め、報告されている #FFFFFF 上の #E0E0E0 という色に対して選択状態を確認します。payload にはソースファイルもテストも記載されていません。完了条件は、選択状態のコントラスト比が少なくとも 3:1 であり、選択状態の伝達を色だけに依存しなくなることです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
accessibility, frontend
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。