Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
91b4a2b3
Unverified
Commit
91b4a2b3
authored
Sep 10, 2020
by
Arthur Maverick
Committed by
GitHub
Sep 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding globalStyled with styled components (#16783)
Co-authored-by:
Joe Haddad
<
joe.haddad@zeit.co
>
parent
47d983f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
_app.js
examples/with-styled-components/pages/_app.js
+15
-4
No files found.
examples/with-styled-components/pages/_app.js
View file @
91b4a2b3
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
=
{
colors
:
{
...
...
@@ -8,8 +16,11 @@ const theme = {
export
default
function
App
({
Component
,
pageProps
})
{
return
(
<
ThemeProvider
theme
=
{
theme
}
>
<
Component
{...
pageProps
}
/
>
<
/ThemeProvider
>
<>
<
GlobalStyle
/>
<
ThemeProvider
theme
=
{
theme
}
>
<
Component
{...
pageProps
}
/
>
<
/ThemeProvider
>
<
/
>
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment