CSS fixes

This commit is contained in:
Jori Lallo
2017-11-07 22:02:07 -08:00
parent 53cda8ce2b
commit 01af3e8c36
7 changed files with 40 additions and 34 deletions

View File

@ -7,17 +7,17 @@ import { darken, lighten } from 'polished';
const RealButton = styled.button`
display: inline-block;
margin: 0;
padding: 0;
padding: 4px 12px;
border: 0;
background: ${color.primary};
color: ${color.white};
border-radius: 4px;
font-size: 15px;
min-width: 32px;
min-height: 32px;
height: 36px;
text-decoration: none;
flex-shrink: 0;
outline: none;
cursor: pointer;
&::-moz-focus-inner {
padding: 0;
@ -70,24 +70,9 @@ const Label = styled.span`
${props => props.hasIcon && 'padding-left: 2px;'}
`;
const Inner = styled.span`
padding: 4px 16px;
display: flex;
line-height: 28px;
justify-content: center;
align-items: center;
${props => props.small && `
padding: 1px 10px;
`}
${props => props.hasIcon && (props.small ? 'padding-left: 6px;' : 'padding-left: 10px;')}
`;
export type Props = {
type?: string,
value?: string,
small?: boolean,
icon?: React$Element<any>,
className?: string,
children?: React$Element<any>,
@ -97,7 +82,6 @@ export default function Button({
type = 'text',
icon,
children,
small,
value,
...rest
}: Props) {
@ -106,10 +90,8 @@ export default function Button({
return (
<RealButton {...rest}>
<Inner hasIcon={hasIcon} small={small}>
{hasIcon && icon}
{hasText && <Label hasIcon={hasIcon}>{children || value}</Label>}
</Inner>
{hasIcon && icon}
{hasText && <Label hasIcon={hasIcon}>{children || value}</Label>}
</RealButton>
);
}