Skip to content

Commit

Permalink
Fix: full width buttons not centering content
Browse files Browse the repository at this point in the history
  • Loading branch information
csansoon committed Oct 1, 2024
1 parent f3ef333 commit 0025259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/web-ui/src/ds/atoms/Button/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(
)}
<div
className={cn('flex flex-row items-center gap-x-1', {
'w-full': fullWidth,
'w-full justify-center': fullWidth,

This comment has been minimized.

Copy link
@andresgutgon

andresgutgon Oct 1, 2024

Contributor

It would be better to understand how this was broken. Maybe is a way of doing what we did without breaking the old behaviour

This comment has been minimized.

Copy link
@csansoon

csansoon Oct 1, 2024

Author Contributor

I had to add a relative class to this div's parent, in order to add the shining effect (an absolute div moving from side to side).

Now this relative seems to change how the child calculates its width.

This comment has been minimized.

Copy link
@andresgutgon

andresgutgon Oct 1, 2024

Contributor

Nice you found the error, I would try to fix the root cause. Is weird that prop fullWidth also center the content

This comment has been minimized.

Copy link
@csansoon

csansoon Oct 1, 2024

Author Contributor

Is it? I don't think we have any case of a full width button where it isn't centerd?

})}
>
{iconProps ? <Icon {...iconProps} /> : null}
Expand Down

0 comments on commit 0025259

Please sign in to comment.