Skip to content

Instantly share code, notes, and snippets.

@d4rekanguok
Last active January 9, 2019 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save d4rekanguok/157cba5b01487291ff5b2923cb9379ec to your computer and use it in GitHub Desktop.
Save d4rekanguok/157cba5b01487291ff5b2923cb9379ec to your computer and use it in GitHub Desktop.
const Button = styled<IStyle, 'button'>('button')`
display: inline-block;
font-weight: bold;
font-weight: ${getFontWeightFromSize};
text-align: center;
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
vertical-align: middle;
padding: ${props => (props.icon ? '0.5em' : '0.5em 1em')};
line-height: ${props => (props.icon ? '0' : '1')};
background: ${props => (props.outline ? 'transparent' : getColor('main'))};
border-radius: ${getBorderRadius};
font-size: ${getFontSize};
border-width: ${getBorderWidth};
border-style: solid;
border-color: ${getColor('main')};
color: #fff;
&:hover,
&:focus {
transform: translateY(-1px);
background: ${props =>
props.outline ? 'rgba(255,255,255,0.12)' : getColor('lighter')};
box-shadow: ${props =>
props.color === 'link' ? 'none' : '0 1px 0 0 rgba(0, 0, 0, 0.4)'};
}
&:focus {
outline: 2px dotted rgba(255, 255, 255, 0.4);
}
&:active {
transform: translateY(0);
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment