Last active
March 14, 2022 19:23
-
-
Save chunkydotdev/ba3be2cdaa6a5c6cbffc71e5f49cb943 to your computer and use it in GitHub Desktop.
A component that uses some theme variables from ThemeProvider
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 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