-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global CSS Support #8710
Merged
Merged
Global CSS Support #8710
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
63ab22e
Global CSS Support
Timer 6954e34
Fix webpack configuration
Timer ae6674a
oneOf rule isn't necessary yet
Timer a149ab7
Adjust CSS chunk naming
Timer 76f57be
Begin testing CSS behavior
Timer ce594b9
Add another test TODO
Timer 2fd94e4
Merge branch 'canary' into global-css
Timer cefc374
Replace null-loader with ignore-loader
Timer e242d8d
Turn on chunks for new CSS feature
Timer bce44e8
Merge branch 'canary' into global-css
Timer d22d5bb
Fix multi test suite
Timer 9c0da3a
Test CSS import order
Timer 95b1d08
Test style HMR
Timer 9a7b79a
Test CSS compilation
Timer d890f82
Test compilation and prefixing together
Timer d81e02e
Verify CSS styling works for Development and Production
Timer 0afd8ad
Add missing TODO
Timer 5e6517b
Remove unnecessary test
Timer 3e834a5
Adjust TODO message
Timer 898d4e0
Hide page until React hydrates
Timer 9bef0ef
Revert "Hide page until React hydrates"
Timer 598c81e
Merge branch 'canary' into global-css
Timer 66c2dbb
Hide FOUC during development
Timer 3244161
Test CSS imports
Timer f71a8cb
Update tests TODO
Timer c387fac
Add fixture for url() test
Timer bd64ad4
Test `file-loader` support in CSS files
Timer a80eb72
Merge branch 'canary' into global-css
Timer 3534892
Merge branch 'canary' into global-css
Timer 0f977e5
Use a simple variant of cssnano
Timer 3e00d28
Self-import
Timer 58098af
Undo bundling
Timer 9684173
Merge branch 'canary' into global-css
ijjk e28f26f
Merge branch 'canary' into global-css
Timer a953442
Implement suggestion
Timer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
test/integration/css/fixtures/compilation-and-prefixing/pages/_app.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react' | ||
import App from 'next/app' | ||
import '../styles/global.css' | ||
|
||
class MyApp extends App { | ||
render () { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
} | ||
|
||
export default MyApp |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/compilation-and-prefixing/pages/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home () { | ||
return <div className='red-text'>This text should be red.</div> | ||
} |
5 changes: 5 additions & 0 deletions
5
test/integration/css/fixtures/compilation-and-prefixing/styles/global.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@media (480px <= width < 768px) { | ||
::placeholder { | ||
color: green; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
test/integration/css/fixtures/invalid-global-with-app/pages/_app.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
import App from 'next/app' | ||
|
||
class MyApp extends App { | ||
render () { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
} | ||
|
||
export default MyApp |
5 changes: 5 additions & 0 deletions
5
test/integration/css/fixtures/invalid-global-with-app/pages/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import '../styles/global.css' | ||
|
||
export default function Home () { | ||
return <div className='red-text'>This text should be red.</div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/invalid-global-with-app/styles/global.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red-text { | ||
color: red; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import '../styles/global.css' | ||
|
||
export default function Home () { | ||
return <div className='red-text'>This text should be red.</div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/invalid-global/styles/global.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red-text { | ||
color: red; | ||
} |
13 changes: 13 additions & 0 deletions
13
test/integration/css/fixtures/multi-global-reversed/pages/_app.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react' | ||
import App from 'next/app' | ||
import '../styles/global2.css' | ||
import '../styles/global1.css' | ||
|
||
class MyApp extends App { | ||
render () { | ||
const { Component, pageProps } = this.props | ||
return <Component {...pageProps} /> | ||
} | ||
} | ||
|
||
export default MyApp |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/multi-global-reversed/pages/index.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function Home () { | ||
return <div className='red-text'>This text should be red.</div> | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/multi-global-reversed/styles/global1.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.red-text { | ||
color: red; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/integration/css/fixtures/multi-global-reversed/styles/global2.css
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.blue-text { | ||
color: blue; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for using dangerouslySetInnerHTML here rather than a text node?