Skip to content

Commit

Permalink
Fix logic of has-text class addition in Button
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Dec 14, 2023
1 parent 4cc9ec4 commit 9c5f676
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/components/src/button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function UnforwardedButton(
'is-busy': isBusy,
'is-link': variant === 'link',
'is-destructive': isDestructive,
'has-text': !! icon && hasChildren,
'has-text': !! icon && ( hasChildren || text ),
'has-icon': !! icon,
} );

Expand Down
2 changes: 2 additions & 0 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
&.has-icon:not(.has-text) {
padding: 0;
width: $button-size-compact;
min-width: $button-size-compact;
}
}
Expand All @@ -282,6 +283,7 @@

&.has-icon:not(.has-text) {
padding: 0;
width: $button-size-small;
min-width: $button-size-small;
}
}
Expand Down

0 comments on commit 9c5f676

Please sign in to comment.