Skip to content

Commit c727396

Browse files
committed
refactor(CButton): improve variants handling
1 parent 932d00f commit c727396

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/coreui-react/src/components/button/CButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ export const CButton: PolymorphicRefForwardingComponent<'button', CButtonProps>
7474
{...(!rest.href && { type: type })}
7575
className={classNames(
7676
'btn',
77-
variant && color ? `btn-${variant}-${color}` : `btn-${variant}`,
7877
{
79-
[`btn-${color}`]: color && !variant,
78+
[`btn-${variant}-${color}`]: variant && color,
79+
[`btn-${variant}`]: variant && !color,
80+
[`btn-${color}`]: !variant && color,
8081
[`btn-${size}`]: size,
8182
},
8283
shape,

0 commit comments

Comments
 (0)