Skip to content

Commit

Permalink
min width based on sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
hetunandu committed Nov 12, 2024
1 parent eb2004c commit 9d2bac7
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const getSizes = (size: ButtonSizes, isIconButton?: boolean) => {
? "var(--ads-v2-spaces-2)"
: "var(--ads-v2-spaces-2) var(--ads-v2-spaces-3)"};
--button-gap: var(--ads-v2-spaces-2);
--button-min-width: 60px;
`,
md: css`
--button-font-weight: 600;
Expand All @@ -37,6 +38,7 @@ const getSizes = (size: ButtonSizes, isIconButton?: boolean) => {
? "var(--ads-v2-spaces-3)"
: "var(--ads-v2-spaces-3) var(--ads-v2-spaces-4)"};
--button-gap: var(--ads-v2-spaces-3);
--button-min-width: 80px;
`,
};

Expand Down Expand Up @@ -175,6 +177,8 @@ export const ButtonContent = styled.div<{
box-sizing: border-box;
padding: var(--button-padding);
border-radius: inherit;
min-width: ${({ isIconButton }) =>
isIconButton ? "unset" : "var(--button-min-width)"};
& > .${ButtonContentChildrenClassName} {
display: flex;
Expand Down Expand Up @@ -229,7 +233,8 @@ export const StyledButton = styled.button<{
padding: 0;
box-sizing: border-box;
overflow: hidden;
min-width: ${({ isIconButton }) => (isIconButton ? "unset" : "60px")};
min-width: ${({ isIconButton }) =>
isIconButton ? "unset" : "fit-content"};
/* button disabled style */
&[data-disabled="true"] {
Expand Down

0 comments on commit 9d2bac7

Please sign in to comment.