Components: Ensure Consistent Button Focus Styling Across ItemGroup Button
and Button
#69289
+3
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Closes #67747
This PR standardizes focus styles for buttons rendered via
ItemGroup
Button and theButton
component, ensuring visual consistency.Why?
Currently, buttons in the repository use different approaches for focus styles—some rely on
:focus
, while others use:focus-visible
. This inconsistency leads to uneven focus behavior, impacting both UI consistency and accessibility.A similar issue was highlighted in this PR comment, where the focus styles in the trunk were deemed superior to the newer changes. Additionally, after the merge of this PR, ItemGroup was replaced with a Button, resolving part of the inconsistency.
How?
Screenshots or screencast
:focus
, the CSS is set to none, as shown here. This is inconsistent with the Button component, which has a box-shadow and outline applied in the:focus
pseudo-state. (See the 3rd screenshot for reference.):focus-visible
, meaning the button does not receive focus styling when clicked with a mouse.:focus
state. We aim to replicate this behavior in the ItemGroup button for consistency.