Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
Assert palette in button styled component
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed Oct 26, 2018
1 parent fb1b8eb commit c568efc
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Button/styled.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ const linkProperties = css`
border: 0;
background: unset;
box-shadow: unset !important;
color: ${props => (props.palette === 'default' ? palette('text')(props) : palette()(props))};
color: ${props => (props.palette === 'default' ? palette('text')(props) : palette()(props) || '')};
text-decoration: underline;
&:hover {
color: ${props =>
props.palette === 'default' ? darken(0.5, palette('text')(props)) : darken(0.5, palette()(props))};
props.palette === 'default' ? darken(0.5, palette('text')(props)) : darken(0.5, palette()(props) || '')};
}
}
& {
Expand Down Expand Up @@ -83,10 +83,10 @@ const disabledProperties = css`

const interactiveProperties = css`
&:hover {
background-color: ${props => darken(0.05, palette()(props))};
background-color: ${props => darken(0.05, palette()(props) || '')};
}
&:hover:active {
background-color: ${props => darken(0.1, palette()(props))};
background-color: ${props => darken(0.1, palette()(props) || '')};
}
`;
const loadingProperties = css`
Expand All @@ -105,7 +105,7 @@ const loadingProperties = css`
export default styled(Button)`
align-items: center;
background-color: ${palette()};
border: 1px solid ${props => darken(0.2, palette()(props))};
border: 1px solid ${props => darken(0.2, palette()(props) || '')};
border-radius: 4px;
color: ${props => palette(`${props.palette}Inverted`)(props)};
cursor: pointer;
Expand Down

0 comments on commit c568efc

Please sign in to comment.