Skip to content

Instantly share code, notes, and snippets.

@DeMoorJasper
Created May 5, 2018 12:24
Show Gist options
  • Save DeMoorJasper/0618b03a3a73ebe8f42e23e433e5cfb4 to your computer and use it in GitHub Desktop.
Save DeMoorJasper/0618b03a3a73ebe8f42e23e433e5cfb4 to your computer and use it in GitHub Desktop.
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