Skip to content

Commit ce38683

Browse files
author
Jannik Weise
committed
💄 Adjust disabled styling for action button icon
Previously, the entire action button would have its opacity reduced when in a disabled state. This change refactors the styling to apply disabled opacity specifically to the icon slot within the action button. This provides more granular control over the visual appearance of disabled action buttons, allowing the button's text and background to maintain full opacity while only the icon fades. A transition has also been added for a smoother visual effect when the icon's disabled state changes.
1 parent bd5ba33 commit ce38683

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/core/src/components/multi-action-button/action-button/ActionButton.styles.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export const StyledActionButton = styled.button<StyledActionButtonProps>`
163163
$isInteractionDisabled &&
164164
css`
165165
cursor: default;
166-
opacity: 0.5;
167166
`}
168167
169168
/* Optional pulse overlay used by status. */
@@ -185,7 +184,6 @@ export const StyledActionButton = styled.button<StyledActionButtonProps>`
185184
186185
&:disabled {
187186
cursor: default;
188-
opacity: 0.5;
189187
}
190188
191189
${({ $isInteractionDisabled, $backgroundColor, theme }) =>
@@ -207,12 +205,14 @@ export const StyledActionContent = styled.span`
207205
z-index: 1;
208206
`;
209207

210-
export const StyledIconSlot = styled.span<{ $height: number }>`
208+
export const StyledIconSlot = styled.span<{ $height: number; $isDisabled?: boolean }>`
211209
align-items: center;
212210
display: inline-flex;
213211
flex: 0 0 auto;
214212
height: ${({ $height }) => $height}px;
215213
justify-content: center;
214+
opacity: ${({ $isDisabled }) => ($isDisabled ? 0.5 : 1)};
215+
transition: opacity 0.2s ease;
216216
width: ${({ $height }) => $height}px;
217217
`;
218218

packages/core/src/components/multi-action-button/action-button/ActionButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ const ActionButton: FC<ActionButtonProps> = ({
6464

6565
const actionContent = (
6666
<StyledActionContent>
67-
<StyledIconSlot $height={height}>
67+
<StyledIconSlot $height={height} $isDisabled={isActionDisabled}>
6868
{typeof action.icon === 'string' ? (
6969
<Icon icons={[action.icon]} color={actionColor} size={iconSize} />
7070
) : (

0 commit comments

Comments
 (0)