[EuiButton] Use euiDisabledSelector in useEuiButtonColorCSS
#9226
+97
−95
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.
Summary
This PR is a tiny follow-up to #9201 which introduced custom disabled behavior for buttons via
aria-disabled. To support the change in styles, we added the helper selectoreuiDisabledSelectorthat combines:disabledand[aria-disabled="true"]selectors.This PR updates the shared button styles in
useEuiButtonColorCSSto use the neweuiDisabledSelector. This update is mainly a cleanup/enhancement as the styles were also working as expected before for EUI button components as pointer events are removed.Why are we making this change?
💪 Robustness: Ensures that potential custom usages of
useEuiButtonColorCSSwould correctly handle custom disabled selectors viaaria-disabledtoo.Impact to users
🟢 There are no changes required on consumer side.
QA
🧪 Storybook:
Checks:
hasDisabledset totrueorfalseas well asisDisabledset totrueorfalse) and that there is no regression with productionGeneral checklist
@defaultif default values are missing) and playground toggles