Button: add :disabled selector to reset hover color for disabled buttons#53411
Button: add :disabled selector to reset hover color for disabled buttons#53411
:disabled selector to reset hover color for disabled buttons#53411Conversation
|
Accessibility impact with adding |
Thanks for the feedback @alexstine The button component has a rule that resets the hover color using an Actually, now I look at the button component CSS more closely, it might be more consistent. There's already a It would have the same effect. |
Adding disabled style to button's disabled state (and not just using the aria-label selector)
e036aac to
0af8c57
Compare
|
Size Change: +5 B (0%) Total Size: 1.44 MB
ℹ️ View Unchanged
|
true:disabled selector to reset hover color for disabled buttons
|
The scope of this PR has widened slightly. Now the hover color will not show for any buttons with a I think it's a safe change and was probably left out initially? I didn't change anything else to keep the scope of this PR smaller, since there are buttons that have either the |
tellthemachines
left a comment
There was a problem hiding this comment.
This makes sense to me; disabled buttons shouldn't have hover styles at all.
Probably resolves #53177
What?
Adds a
:disabled:hoverselector to reset hover colors for disabled Buttons.Why?
The
<Button />text color does not inherit:hoverstate colors if it has anaria-disabledattribute.But it does not cater for the
"disabled"attribute, which many buttons use without the additionalaria-disabledattribute.This rule
Testing Instructions
Here are a few screen recordings
The new selector will affect all buttons that have disabled states.
For example, the preview icon in the post editor. Add a new post but don't add any content.
Also the Reset revisions button in the site editor (it's disabled once pressed).
2023-08-09.11.35.23.mp4
2023-08-09.11.49.40.mp4
To test that this PR fixes #53177:
Disable code editing. The quick way is to toggle the default editor settings:
Head over to the post editor and open the settings menu at the top right of the page using the ellipsis menu.
See that the color does not change on the disabled button.
Screenshots or screencast
Before
2023-08-08.16.16.12.mp4
After
2023-08-08.16.15.06.mp4