Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions docs/data/material/components/form-label/form-label.a11y.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"FormLabelA11yColorMatrix": {
"rules": {
"aria-allowed-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-conditional-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-prohibited-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr-value": {
"status": "pass",
"tags": ["wcag2a"]
},
"color-contrast": {
"status": "fail",
"tags": ["wcag2aa"]
}
}
},
"FormLabelA11yColorMatrixDark": {
"rules": {
"aria-allowed-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-conditional-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-prohibited-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr-value": {
"status": "pass",
"tags": ["wcag2a"]
},
"color-contrast": {
"status": "pass",
"tags": ["wcag2aa"]
}
}
},
"FormLabelA11yStates": {
"rules": {
"aria-allowed-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-conditional-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-deprecated-role": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-hidden-focus": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-prohibited-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-required-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-roles": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr": {
"status": "pass",
"tags": ["wcag2a"]
},
"aria-valid-attr-value": {
"status": "pass",
"tags": ["wcag2a"]
},
"color-contrast": {
"status": "pass",
"tags": ["wcag2aa"]
},
"duplicate-id-aria": {
"status": "pass",
"tags": ["wcag2a"]
},
"form-field-multiple-labels": {
"status": "pass",
"tags": ["wcag2a"]
},
"label": {
"status": "pass",
"tags": ["wcag2a"]
},
"nested-interactive": {
"status": "pass",
"tags": ["wcag2a"]
},
"target-size": {
"status": "pass",
"tags": ["wcag22aa"]
}
}
}
}
22 changes: 12 additions & 10 deletions docs/data/material/getting-started/accessibility/accessibility.md

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions docs/data/material/getting-started/accessibility/knownGaps.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,33 @@
"criteria": ["1.4.3", "1.4.11"],
"affected": [
"Avatar",
"Button",
{ "component": "Button", "note": "`info`, `warning`; `error` in dark mode" },
Comment thread
michelengelen marked this conversation as resolved.
Resolved
{ "component": "CircularProgress", "note": "`warning` with `enableTrackSlot`" },
{
"component": "FormLabel",
"note": "focused `info`, `warning`; `error` on a dark Paper with elevation 2 or more"
},
{ "component": "IconButton", "note": "`info`, `warning`" },
"LinearProgress",
{ "component": "Link", "note": "link text, 1.4.3 only" },
"Switch",
"TextField",
"ToggleButton"
],
"workaround": "Override the affected palette entries"
"workaround": "Override the affected palette entries. In dark mode, set a lighter `error.main`, or keep `error` text on a surface with elevation 0 or 1. Elevation does not help the label of a `filled` TextField"
},
{
"gap": "The selected state of colored Toggle Buttons is conveyed almost entirely by hue",
"criteria": ["1.4.1"],
"affected": [{ "component": "ToggleButton", "note": "`primary`, `error`, `info`, `success`" }],
"workaround": "Add a non-color cue to the selected state, such as an icon"
},
{
"gap": "A required checkbox, radio, or switch group exposes no required state to assistive technology, because Checkbox, Radio, and Switch do not take `required` from FormControl and RadioGroup has no `required` prop",
Comment thread
michelengelen marked this conversation as resolved.
Resolved
"criteria": ["1.3.1"],
"affected": [{ "component": "FormLabel", "note": "`required` group legend" }],
"workaround": "Set `aria-required` on a RadioGroup. Set `required` on a single Checkbox or Switch, or on its FormControlLabel, which forwards it to the control. For a checkbox group, state the requirement in the legend text"
},
{
"gap": "Links without an underline rely on color, and several link colors are below 3:1 against body text",
"criteria": ["1.4.1"],
Expand Down
176 changes: 168 additions & 8 deletions docs/data/material/getting-started/accessibility/scorecard.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"standard": "WCAG 2.2 Level A and AA",
"componentCount": 15,
"componentCount": 16,
"totals": {
"rated": 32,
"supports": 26,
"partiallySupports": 6,
"supports": 25,
"partiallySupports": 7,
"doesNotSupport": 0,
"flagged": 14
"flagged": 15
},
"criteria": [
{
Expand All @@ -21,9 +21,9 @@
"number": "1.3.1",
"name": "Info and Relationships",
"level": "A",
"conformance": "Supports",
"flagged": false,
"affected": []
"conformance": "Partially Supports",
"flagged": true,
"affected": ["FormLabel"]
},
{
"number": "1.3.2",
Expand Down Expand Up @@ -63,7 +63,15 @@
"level": "AA",
"conformance": "Partially Supports",
"flagged": true,
"affected": ["Avatar", "Button", "IconButton", "Link", "TextField", "ToggleButton"]
"affected": [
"Avatar",
"Button",
"FormLabel",
"IconButton",
"Link",
"TextField",
"ToggleButton"
]
},
{
"number": "1.4.4",
Expand Down Expand Up @@ -1558,6 +1566,158 @@
"automated": 1
}
},
{
"component": "FormLabel",
"counts": {
"supports": 11,
"partiallySupports": 2,
"doesNotSupport": 0,
"notApplicable": 42,
"flagged": 3,
"rated": 13
},
"gaps": [
{
"number": "1.3.1",
"name": "Info and Relationships",
"conformance": "Partially Supports"
},
{
"number": "1.4.3",
"name": "Contrast (Minimum)",
"conformance": "Partially Supports"
}
],
"criteria": [
{
"number": "1.3.1",
"name": "Info and Relationships",
"level": "A",
"conformance": "Partially Supports",
"responsibility": "Shared",
"group": "Hybrid",
"flagged": true
},
{
"number": "1.3.2",
"name": "Meaningful Sequence",
"level": "A",
"conformance": "Supports",
"responsibility": "Author",
"group": "Manual",
"flagged": false
},
{
"number": "1.3.3",
"name": "Sensory Characteristics",
"level": "A",
"conformance": "Supports",
"responsibility": "Author",
"group": "Manual",
"flagged": false
},
{
"number": "1.4.1",
"name": "Use of Color",
"level": "A",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Hybrid",
"flagged": true
},
{
"number": "1.4.3",
"name": "Contrast (Minimum)",
"level": "AA",
"conformance": "Partially Supports",
"responsibility": "Component",
"group": "Hybrid",
"flagged": false
},
{
"number": "1.4.4",
"name": "Resize Text",
"level": "AA",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
},
{
"number": "1.4.5",
"name": "Images of Text",
"level": "AA",
"conformance": "Supports",
"responsibility": "Author",
"group": "Manual",
"flagged": false
},
{
"number": "1.4.10",
"name": "Reflow",
"level": "AA",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
},
{
"number": "1.4.12",
"name": "Text Spacing",
"level": "AA",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
},
{
"number": "2.4.6",
"name": "Headings and Labels",
"level": "AA",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Hybrid",
"flagged": false
},
{
"number": "2.5.3",
"name": "Label in Name",
"level": "A",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Automated",
"flagged": false
},
{
"number": "3.3.2",
"name": "Labels or Instructions",
"level": "A",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Hybrid",
"flagged": true
},
{
"number": "4.1.2",
"name": "Name, Role, Value",
"level": "A",
"conformance": "Supports",
"responsibility": "Shared",
"group": "Hybrid",
"flagged": false
}
],
"summary": {
"rated": 13,
"levelA": 7,
"levelAA": 6,
"supports": 11,
"partiallySupports": 2,
"doesNotSupport": 0,
"verified": 10,
"automated": 4
}
},
{
"component": "IconButton",
"counts": {
Expand Down
11 changes: 9 additions & 2 deletions packages/mui-material/src/Button/accessibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Rated against WCAG 2.2 Level A and AA. See the [reports legend](../accessibility

## Known gaps

- ⚠️ **1.4.3 Contrast (Minimum).** <!-- 1.4.3:gap:start -->`info` and `warning` buttons fall short of 4.5:1 in every variant.<!-- 1.4.3:gap:end -->
- ⚠️ **1.4.3 Contrast (Minimum).** <!-- 1.4.3:gap:start -->`info` and `warning` buttons fall short of 4.5:1 in every variant. In dark mode, the `contained` `error` label falls short on every surface, and the `text` and `outlined` `error` labels fall short on a Paper with elevation 2 or more.<!-- 1.4.3:gap:end -->
- ⚠️ **1.4.11 Non-text Contrast.** <!-- 1.4.11:gap:start -->Focus-indicator, border, and icon contrast are untested; `disableRipple`/`disableFocusRipple` remove the `text`/`outlined` focus indicator, and `disableElevation` removes the `contained` one, unless the theme enables `focusVisible`.<!-- 1.4.11:gap:end -->
- ⚠️ **2.2.2 Pause, Stop, Hide.** <!-- 2.2.2:gap:start -->The `loading` spinner turns until `loading` ends, and the user cannot pause it.<!-- 2.2.2:gap:end -->
- ⚠️ **2.4.3 Focus Order.** <!-- 2.4.3:gap:start -->A focused button that turns `loading` becomes disabled, and the browser moves focus to the page body.<!-- 2.4.3:gap:end -->
Expand Down Expand Up @@ -233,15 +233,22 @@ The shortfalls, measured from the default light palette (all pairs against `#fff

Every other `variant` × `color` combination clears `4.5:1`; the closest pass is `primary` at `4.6:1`. The button label (14px, weight 500) does not qualify as WCAG large text, so the `3:1` threshold never applies here.

In the default dark palette, only `error` (`#f44336`) falls short:

- `contained`: the `#fff` label is `3.68:1` on every surface.
- `text` and `outlined`: the label uses `error.main`. It is about `5.09:1` on the page background (`#121212`). The elevation overlay of a Paper lightens the surface. On a Paper with elevation 2 or more, such as a Menu or Dialog, the label falls below `4.5:1`: about `4.3:1` at elevation 2 and `3.14:1` at elevation 24.
- The other dark palette colors reach `4.5:1` in every variant, up to elevation 24.

**Manual testing steps**

1. With a contrast checker (the color picker in browser DevTools shows a ratio), check each button's label against its background, across the color and variant combinations in use.
2. Repeat with the pointer hovering and held down, since `:hover` and `:active` change the background.
3. Check any custom theme colors the product uses.
4. In dark mode, repeat the check for `error` buttons on each Paper surface in use, such as a Menu or Dialog.

<!-- 1.4.3:end -->

**Pass:** <!-- 1.4.3:pass:start -->at least `4.5:1`, or `3:1` for large text, in the resting, hover, and active states. Disabled is exempt; `info` and `warning` are the known failures.<!-- 1.4.3:pass:end -->
**Pass:** <!-- 1.4.3:pass:start -->at least `4.5:1`, or `3:1` for large text, in the resting, hover, and active states. Disabled is exempt; `info` and `warning`, and `error` in dark mode, are the known failures.<!-- 1.4.3:pass:end -->

#### 1.4.11 Non-text Contrast · AA

Expand Down
Loading
Loading