Skip to content

Commit

Permalink
EPMRPP-92701 || Buttons have broken styles (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
BlazarQSO authored Aug 23, 2024
1 parent a749e05 commit fb5a538
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
10 changes: 10 additions & 0 deletions src/components/button/button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
&:focus:not(.disabled, :active) {
border: 2px solid var(--rp-ui-color-primary-focused);
}
svg * {
fill: var(--rp-ui-base-bg-000);
}
}

.ghost {
Expand All @@ -51,6 +54,9 @@
border: 2px solid var(--rp-ui-color-primary-focused);
color: var(--rp-ui-color-primary-focused);
}
svg * {
fill: var(--rp-ui-color-primary-text);
}
}

.danger {
Expand All @@ -67,6 +73,9 @@
&:focus:not(.disabled, :active) {
border: 2px solid var(--rp-ui-color-error-focused);
}
svg * {
fill: var(--rp-ui-base-bg-000);
}
}

.text {
Expand Down Expand Up @@ -124,6 +133,7 @@
.icon-start {
margin: auto 8px auto 0;
}

.icon-end {
margin: auto 0 auto 8px;
order: 1;
Expand Down
6 changes: 2 additions & 4 deletions src/components/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export const Button: FC<ButtonProps> = forwardRef(
[`width-${adjustWidthOn}`]: adjustWidthOn,
});

const buttonIcon = variant === 'text' && icon;

return (
<button
ref={ref}
Expand All @@ -67,13 +65,13 @@ export const Button: FC<ButtonProps> = forwardRef(
title={title}
{...rest}
>
{buttonIcon && (
{icon && (
<i
className={cx('icon', {
[`icon-${iconPlace}`]: iconPlace,
})}
>
{buttonIcon}
{icon}
</i>
)}
{children}
Expand Down

0 comments on commit fb5a538

Please sign in to comment.