Skip to content

Instantly share code, notes, and snippets.

@sht5
Last active December 8, 2018 19:05
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 sht5/da77f459a281314696581faba449b1ba to your computer and use it in GitHub Desktop.
Save sht5/da77f459a281314696581faba449b1ba to your computer and use it in GitHub Desktop.
styled components example
const Button = styled.button`
background: ${props => props.primary ? "blue" : "white"};
color: ${props => props.primary ? "white" : "blue"};
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border: 2px solid palevioletred;
border-radius: 3px;
`;
render(
<div>
<Button>Normal</Button>
<Button primary>Primary</Button>
</div>
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment