Skip to content

[docs][button] Measure hover contrast in the 1.4.3 report - #49932

Merged
LukasTy merged 8 commits into
mui:masterfrom
LukasTy:claude/nice-keller-63efa0
Dec 2, 2026
Merged

LukasTy merged 8 commits into
mui:masterfrom
LukasTy:claude/nice-keller-63efa0

Conversation

@LukasTy

@LukasTy LukasTy commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

The Button 1.4.3 report measured only the resting state and said that :hover and :active need a visual check. This PR adds the measured :hover ratios for all three variants and the six named palette colors, in light and dark mode.

For those colors, the text and outlined background on hover is palette[color].main at action.hoverOpacity (0.04 in light mode, 0.08 in dark mode) over the surface. The contained background changes to palette[color].dark. With color="inherit", the label takes its color from its parent, and a contained button uses a gray hover background in the default theme.

New failures on hover:

  • Light text/outlined primary (the default Button): 4.60:1 at rest, 4.37:1 on hover.
  • Dark contained secondary: rgba(0, 0, 0, 0.87) on #ab47bc is 4.01:1 on every surface.
  • Dark text/outlined on a Paper: error from elevation 1 (4.19:1), and secondary, info, and success on a Dialog (4.22:1, 4.41:1, and 4.27:1). The secondary value on a Drawer (4.49:1) is borderline.

Changes:

  • Button/accessibility.md: the 1.4.3 gap, section, manual testing steps, and pass text.
  • knownGaps.json: a note on the Button entry of the palette row. The dark error workaround now asks for elevation 0 for a hovered text or outlined Button, and says that elevation does not help a contained Button.
  • manual-testing.md and the accessibility overview: regenerated by pnpm a11y:scorecard.

The 1.4.3 rating stays Partially Supports. The hover failures share the root cause of the existing palette gap, so they add no new warning. :active (the ripple) is still a visual check.

The values use the WCAG relative luminance formula with float compositing of the hover tint and the Paper overlay from getOverlayAlpha.

This builds on the dark-mode error resting results from #49552. The hover data follows them in the 1.4.3 section.

Generated with Claude Code

The hover tint lowers the text and outlined label contrast. The default
light primary Button drops to 4.37:1, and several dark-mode colors fall
below 4.5:1 on a Paper surface.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@LukasTy LukasTy added docs Improvements or additions to the documentation. accessibility a11y scope: button Changes related to the button. labels Nov 27, 2026
…r-63efa0

# Conflicts:
#	docs/data/material/getting-started/accessibility/accessibility.md
#	docs/data/material/getting-started/accessibility/knownGaps.json
#	packages/mui-material/src/Button/accessibility.md
#	packages/mui-material/src/manual-testing.md
@code-infra-dashboard

code-infra-dashboard Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Deploy preview

Bundle size

Bundle Parsed size Gzip size
@mui/material 0B(0.00%) 0B(0.00%)
@mui/lab 0B(0.00%) 0B(0.00%)
@mui/private-theming 0B(0.00%) 0B(0.00%)
@mui/system 0B(0.00%) 0B(0.00%)
@mui/utils 0B(0.00%) 0B(0.00%)

Details of bundle changes

Performance

No regressions in 32 benchmarks · precise to ±8.6% (±12.8% at worst) · ran 4m 45s · details


Check out the code infra dashboard for more information about this PR.

@github-actions github-actions Bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
LukasTy and others added 2 commits November 27, 2026 13:21
…r-63efa0

# Conflicts:
#	docs/data/material/getting-started/accessibility/accessibility.md
A hovered text or outlined error Button fails at elevation 1, so the
workaround now asks for elevation 0, and elevation cannot help a
contained Button. Mark the secondary Drawer value as borderline, and
name the variants for the light info and warning hover ratios.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added PR: out-of-date The pull request has merge conflicts and can't be merged. and removed PR: out-of-date The pull request has merge conflicts and can't be merged. labels Nov 27, 2026
LukasTy and others added 2 commits November 27, 2026 14:23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r-63efa0

# Conflicts:
#	docs/data/material/getting-started/accessibility/accessibility.md
#	docs/data/material/getting-started/accessibility/knownGaps.json
#	docs/data/material/getting-started/accessibility/scorecard.json
#	packages/mui-material/src/Button/accessibility.md
@github-actions github-actions Bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Nov 27, 2026
@LukasTy LukasTy self-assigned this Nov 27, 2026
@LukasTy
LukasTy marked this pull request as ready for review November 27, 2026 13:12
…r-63efa0

# Conflicts:
#	docs/data/material/getting-started/accessibility/accessibility.md
@LukasTy
LukasTy merged commit 0b80c23 into mui:master Dec 2, 2026
23 checks passed
@LukasTy
LukasTy deleted the claude/nice-keller-63efa0 branch December 2, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility a11y docs Improvements or additions to the documentation. scope: button Changes related to the button.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants