Skip to content

Commit 8ab945e

Browse files
committed
refactor(CButton): improve colors and variants handling
1 parent df09e84 commit 8ab945e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ export const CButton: PolymorphicRefForwardingComponent<'button', CButtonProps>
7474
{...(!rest.href && { type: type })}
7575
className={classNames(
7676
'btn',
77-
variant ? `btn-${variant}-${color}` : `btn-${color}`,
78-
{ [`btn-${size}`]: size },
77+
{
78+
[`btn-${color}`]: color && !variant,
79+
[`btn-${variant}-${color}`]: color && variant,
80+
[`btn-${size}`]: size,
81+
},
7982
shape,
8083
className,
8184
)}

0 commit comments

Comments
 (0)