Skip to content

Commit

Permalink
Merge pull request #2470 from habx/feature/Button
Browse files Browse the repository at this point in the history
APP-34091: feat(Button): add size `tiny`
  • Loading branch information
habxtech authored Nov 29, 2022
2 parents 904e04a + e08fe0d commit 80880b3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Button/Button.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export interface ButtonProps
*/
small?: boolean

/**
* Tiny size
*/
tiny?: boolean

/**
* @ignore
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Button/Button.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,17 @@ export const ButtonContainer = styled.button`
}
}
&[data-tiny='true'] {
font-size: ${fontScale.asteroid.size}px;
padding: 0 12px;
--button-height: 36px;
--button-side-element-margin: 8px;
& ${SideElementContainer} {
font-size: 20px;
}
}
&[data-mode='${ButtonModes.solid}'] {
background-color: ${theme.color('primary', { dynamic: true })};
color: ${theme.color('primary', {
Expand Down
2 changes: 2 additions & 0 deletions src/Button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const InnerButton = React.forwardRef<HTMLButtonElement, ButtonProps>(
ghost = false,
link = false,
small = false,
tiny = false,
fullWidth = false,
dangerouslySetInnerHTML,
type = 'button',
Expand Down Expand Up @@ -49,6 +50,7 @@ const InnerButton = React.forwardRef<HTMLButtonElement, ButtonProps>(
data-loading={loading}
data-mode={mode}
data-small={small}
data-tiny={tiny}
data-full-width={fullWidth}
type={type}
{...rest}
Expand Down

0 comments on commit 80880b3

Please sign in to comment.