Skip to content

Instantly share code, notes, and snippets.

@chunkydotdev
Last active March 14, 2022 19:23
Show Gist options
  • Save chunkydotdev/ba3be2cdaa6a5c6cbffc71e5f49cb943 to your computer and use it in GitHub Desktop.
Save chunkydotdev/ba3be2cdaa6a5c6cbffc71e5f49cb943 to your computer and use it in GitHub Desktop.
A component that uses some theme variables from ThemeProvider
import styled from 'styled-components'
const PrimaryButton = styled.button`
background-color: ${({theme}) => theme.colors.primary};
border: 0;
margin-bottom: ${({theme}) => theme.spacings.md};
`
const Component1 = () => {
return <>
<h1>Below there will be a button that is using the primary colors from our theme</h1>
<PrimaryButton>Click me</PrimaryButton>
<p>There is some margin above me</p>
</>
}
export default Component1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment