Created
October 14, 2021 12:09
-
-
Save akinogu/c5d25e256b94b1e83982ef945b71aa19 to your computer and use it in GitHub Desktop.
[styled-components]theme
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, { ThemeProvider } from 'styled-components' | |
const Button = styled.button` | |
color: ${p => p.theme.color}; // ← green | |
` | |
export const App = () => { | |
return ( | |
<ThemeProvider theme={{ color: 'green' }}> | |
<Button>Themed</Button> | |
</ThemeProvider> | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment