Adding globalStyled with styled components (#16783)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
This commit is contained in:
parent
47d983f71f
commit
91b4a2b37e
1 changed files with 15 additions and 4 deletions
|
@ -1,4 +1,12 @@
|
||||||
import { ThemeProvider } from 'styled-components'
|
import { createGlobalStyle, ThemeProvider } from 'styled-components'
|
||||||
|
|
||||||
|
const GlobalStyle = createGlobalStyle`
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
`
|
||||||
|
|
||||||
const theme = {
|
const theme = {
|
||||||
colors: {
|
colors: {
|
||||||
|
@ -8,8 +16,11 @@ const theme = {
|
||||||
|
|
||||||
export default function App({ Component, pageProps }) {
|
export default function App({ Component, pageProps }) {
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={theme}>
|
<>
|
||||||
<Component {...pageProps} />
|
<GlobalStyle />
|
||||||
</ThemeProvider>
|
<ThemeProvider theme={theme}>
|
||||||
|
<Component {...pageProps} />
|
||||||
|
</ThemeProvider>
|
||||||
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue