Last active
November 29, 2021 00:17
-
-
Save chadspencer/11e7a03cb7f7bb6ebafbde53648f22ad to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { cx, css } from 'emotion'; | |
const button = { | |
background: black, | |
color: white, | |
'& + &': { | |
marginLeft: '8px', | |
} | |
}; | |
const buttonPrimary = { | |
background: red, | |
}; | |
const buttonSecondary = { | |
background: green, | |
}; | |
const classes = cx( | |
css(button), | |
{[css(buttonPrimary)]: this.props.type === 'primary'}, | |
{[css(buttonSecondary)]: this.props.type === 'secondary'}, | |
); | |
render( | |
<button | |
className={classes} | |
/> | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment