-
-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adding media, supports and layer for external import (#1072)
- Loading branch information
1 parent
82f4a47
commit 60c5331
Showing
6 changed files
with
82 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@import url(http://some/path/to/css1.css); | ||
@import url(http://some/path/to/css2.css) screen and (max-width: 1024px); | ||
@import url(http://some/path/to/css3.css) supports(display: grid) screen and | ||
(max-width: 400px); | ||
@import url(http://some/path/to/css4.css) supports(display: grid); | ||
@import url(http://some/path/to/css5.css) layer(); | ||
@import url(http://some/path/to/css6.css) layer; | ||
@import url(http://some/path/to/css7.css) layer(layer-name) | ||
supports(display: grid) screen and (max-width: 1024px); | ||
@import url(http://some/path/to/css8.css) layer(layer-name) screen and | ||
(max-width: 1024px); | ||
|
||
body { | ||
background: 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 url("https://some/external/css"); | ||
|
||
.b { | ||
background: red; | ||
} |
19 changes: 19 additions & 0 deletions
19
test/cases/at-import-external-with-media/expected/main.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,19 @@ | ||
@import url(http://some/path/to/css1.css); | ||
@import url(http://some/path/to/css2.css) screen and (max-width: 1024px); | ||
@import url(http://some/path/to/css3.css) supports(display: grid) screen and | ||
(max-width: 400px); | ||
@import url(http://some/path/to/css4.css) supports(display: grid); | ||
@import url(http://some/path/to/css5.css) layer; | ||
@import url(http://some/path/to/css6.css) layer; | ||
@import url(http://some/path/to/css7.css) layer(layer-name) supports(display: grid) screen and (max-width: 1024px); | ||
@import url(http://some/path/to/css8.css) layer(layer-name) screen and | ||
(max-width: 1024px); | ||
@import url(https://some/external/css); | ||
body { | ||
background: red; | ||
} | ||
|
||
.b { | ||
background: 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,2 @@ | ||
import "./a.css"; | ||
import "./b.css"; |
18 changes: 18 additions & 0 deletions
18
test/cases/at-import-external-with-media/webpack.config.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,18 @@ | ||
import Self from "../../../src"; | ||
|
||
module.exports = { | ||
entry: "./index.js", | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.css$/, | ||
use: [Self.loader, "css-loader"], | ||
}, | ||
], | ||
}, | ||
plugins: [ | ||
new Self({ | ||
filename: "[name].css", | ||
}), | ||
], | ||
}; |