Created
May 6, 2019 18:58
-
-
Save mfix22/2e5f8227867f8b3e7b638b85f4ef55f0 to your computer and use it in GitHub Desktop.
Create a global custom styles component
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 { ThemeProvider, createGlobalStyle, css } from 'styled-components' | |
export const CustomStyles = createGlobalStyle`${props => | |
css` | |
${props.children}; | |
`}`; | |
// Usage | |
<ThemeProvider theme={theme}> | |
{props.children} | |
<CustomStyles> | |
{/* user's custom styled go here */} | |
{userTheme.customStyles} | |
</CustomStyles> | |
</ThemeProvider> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment