Created
May 5, 2018 12:24
-
-
Save DeMoorJasper/0618b03a3a73ebe8f42e23e433e5cfb4 to your computer and use it in GitHub Desktop.
This file contains 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 { stylish } from 'tiny-stylish-components'; | |
let bg = '#ffffff'; | |
let color = '#ffffff'; | |
let randomColor = () => `#${Array.apply(null, Array(6)).map(el => '0123456789ABCDEF'[Math.floor(Math.random() * 16)]).join('')}`; | |
const Button = stylish.button` | |
background: ${bg}; | |
color: ${color}; | |
border: 1px solid ${randomColor()}; | |
border-radius: 5px; | |
width: 100px; | |
padding: 5px 10px; | |
${props => props.primary && css` | |
background: palevioletred; | |
color: white; | |
`} | |
`; | |
export default () => { | |
return <div> | |
<Button>Button ๐</Button> | |
<Button primary="true">Button ๐</Button> | |
</div>; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment