Skip to content

Commit

Permalink
feat: Add a small button type
Browse files Browse the repository at this point in the history
  • Loading branch information
jerelmiller committed Jul 7, 2020
1 parent cede4ff commit 9650393
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/components/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ const Button = ({
children,
className,
variant,
size,
...props
}) => (
<Component
{...props}
className={cx(className, styles.button, styles[variant])}
className={cx(className, styles.button, styles[variant], styles[size])}
>
{children}
</Component>
Expand All @@ -24,10 +25,15 @@ Button.VARIANT = {
NORMAL: 'normal',
};

Button.SIZE = {
SMALL: 'small',
};

Button.propTypes = {
as: PropTypes.elementType,
children: PropTypes.node,
className: PropTypes.string,
size: PropTypes.oneOf([Object.values(Button.SIZE)]),
type: PropTypes.oneOf(['button', 'submit', 'reset']),
variant: PropTypes.oneOf(Object.values(Button.VARIANT)).isRequired,
};
Expand Down
4 changes: 4 additions & 0 deletions src/components/Button.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@
color: var(--color-brand-400);
}
}

.small {
font-size: 0.75rem;
}

0 comments on commit 9650393

Please sign in to comment.