tweaked button styles

This commit is contained in:
Jori Lallo
2017-11-07 23:29:04 -08:00
parent 9516bea171
commit 56c79e1e3b

View File

@ -7,7 +7,7 @@ import { darken, lighten } from 'polished';
const RealButton = styled.button`
display: inline-block;
margin: 0;
padding: 4px 12px;
padding: 0;
border: 0;
background: ${color.primary};
color: ${color.white};
@ -59,6 +59,7 @@ const RealButton = styled.button`
&:disabled {
background: ${color.slateLight};
cursor: default;
}
`;
@ -70,6 +71,16 @@ const Label = styled.span`
${props => props.hasIcon && 'padding-left: 2px;'}
`;
const Inner = styled.span`
padding: 0 12px;
display: flex;
line-height: 28px;
justify-content: center;
align-items: center;
${props => props.hasIcon && (props.small ? 'padding-left: 6px;' : 'padding-left: 10px;')}
`;
export type Props = {
type?: string,
value?: string,
@ -90,8 +101,10 @@ export default function Button({
return (
<RealButton {...rest}>
{hasIcon && icon}
{hasText && <Label hasIcon={hasIcon}>{children || value}</Label>}
<Inner hasIcon={hasIcon}>
{hasIcon && icon}
{hasText && <Label hasIcon={hasIcon}>{children || value}</Label>}
</Inner>
</RealButton>
);
}