This repository was archived by the owner on Dec 19, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Expand file tree Collapse file tree 3 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 42
42
"postcss-color-hwb" : " ^1.1.0" ,
43
43
"postcss-color-rebeccapurple" : " ^1.1.0" ,
44
44
"postcss-color-rgba-fallback" : " ^1.0.0" ,
45
- "postcss-custom-media" : " ^1.3 .0" ,
46
- "postcss-custom-properties" : " ^3 .0.0" ,
45
+ "postcss-custom-media" : " ^4.0 .0" ,
46
+ "postcss-custom-properties" : " ^4 .0.0" ,
47
47
"postcss-custom-selectors" : " ^2.0.1" ,
48
48
"postcss-font-variant" : " ^1.0.0" ,
49
- "postcss-import" : " ^5 .0.0" ,
49
+ "postcss-import" : " ^6 .0.0" ,
50
50
"postcss-log-warnings" : " ^0.3.1" ,
51
51
"postcss-media-minmax" : " ^1.1.0" ,
52
52
"postcss-messages" : " ^0.2.2" ,
Original file line number Diff line number Diff line change @@ -11,7 +11,16 @@ const msg = "This is a test message"
11
11
const page = path . join ( "dist" , "__tests__styles.html" )
12
12
13
13
const css = cssnext (
14
- "@custom-selector --h h1, h2; @custom-selector --H h3, h4; body{}" ,
14
+ `
15
+ @import url(http://)
16
+ :root {
17
+ --var: test;
18
+ }
19
+ @custom-selector --h h1, h2;
20
+ body {
21
+ color: var(--test);
22
+ }
23
+ ` ,
15
24
{
16
25
plugins : [
17
26
( styles , result ) => {
Original file line number Diff line number Diff line change @@ -70,22 +70,24 @@ function cssnext(string, options) {
70
70
if ( fs && fs . readFile ) {
71
71
// @import
72
72
if ( options . import !== false ) {
73
- postcss . use ( require ( "postcss-import" ) (
73
+ const plugin = require ( "postcss-import" ) (
74
74
typeof options . import === "object"
75
75
? { ...options . import }
76
76
: undefined
77
77
)
78
- )
78
+ plugin . postcssPlugin = "cssnext"
79
+ postcss . use ( plugin )
79
80
}
80
81
81
82
// url() adjustements
82
83
if ( options . url !== false ) {
83
- postcss . use ( require ( "postcss-url" ) (
84
+ const plugin = require ( "postcss-url" ) (
84
85
typeof options . url === "object"
85
86
? { ...options . url }
86
87
: undefined
87
88
)
88
- )
89
+ plugin . postcssPlugin = "cssnext"
90
+ postcss . use ( plugin )
89
91
}
90
92
}
91
93
@@ -114,12 +116,13 @@ function cssnext(string, options) {
114
116
)
115
117
)
116
118
) {
117
- postcss . use ( cssnext . features [ key ] (
119
+ const plugin = cssnext . features [ key ] (
118
120
typeof features [ key ] === "object"
119
121
? { ...features [ key ] }
120
122
: undefined
121
123
)
122
- )
124
+ plugin . postcssPlugin = "cssnext"
125
+ postcss . use ( plugin )
123
126
}
124
127
} )
125
128
You can’t perform that action at this time.
0 commit comments