From 9c5f676eef5f8db613fbf0f5936c43b0b8d3f629 Mon Sep 17 00:00:00 2001 From: ntsekouras Date: Thu, 14 Dec 2023 14:37:05 +0200 Subject: [PATCH] Fix logic of has-text class addition in Button --- packages/components/src/button/index.tsx | 2 +- packages/components/src/button/style.scss | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/components/src/button/index.tsx b/packages/components/src/button/index.tsx index b14e85fa52f7f..bd91de2ec2e83 100644 --- a/packages/components/src/button/index.tsx +++ b/packages/components/src/button/index.tsx @@ -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, } ); diff --git a/packages/components/src/button/style.scss b/packages/components/src/button/style.scss index 77dd1ff1b1885..0af5144d3d4b7 100644 --- a/packages/components/src/button/style.scss +++ b/packages/components/src/button/style.scss @@ -270,6 +270,7 @@ &.has-icon:not(.has-text) { padding: 0; + width: $button-size-compact; min-width: $button-size-compact; } } @@ -282,6 +283,7 @@ &.has-icon:not(.has-text) { padding: 0; + width: $button-size-small; min-width: $button-size-small; } }