Skip to content

Instantly share code, notes, and snippets.

@fjaguero
Last active June 6, 2017 12:09
Show Gist options
  • Save fjaguero/58aab7d6688712f193fc2bf6b0b79269 to your computer and use it in GitHub Desktop.
Save fjaguero/58aab7d6688712f193fc2bf6b0b79269 to your computer and use it in GitHub Desktop.
Styled components: Using props from a <ThemeProvider />
// Define our button, but with the use of props.theme this time
const Button = styled.button`
font-size: 1em;
margin: 1em;
padding: 0.25em 1em;
border-radius: 3px;
/* Color the border and text with theme properties */
color: ${props => props.theme.darkGray};
border: 2px solid ${props => props.theme.darkGray};
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment