Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

Commit feb1d30

Browse files
committed
1.7.0
Close #97 Close #154 Close #101
1 parent c9e936a commit feb1d30

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
"postcss-color-hwb": "^1.1.0",
4343
"postcss-color-rebeccapurple": "^1.1.0",
4444
"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",
4747
"postcss-custom-selectors": "^2.0.1",
4848
"postcss-font-variant": "^1.0.0",
49-
"postcss-import": "^5.0.0",
49+
"postcss-import": "^6.0.0",
5050
"postcss-log-warnings": "^0.3.1",
5151
"postcss-media-minmax": "^1.1.0",
5252
"postcss-messages": "^0.2.2",

src/__tests__/messages/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,16 @@ const msg = "This is a test message"
1111
const page = path.join("dist", "__tests__styles.html")
1212

1313
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+
`,
1524
{
1625
plugins: [
1726
(styles, result) => {

src/index.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,22 +70,24 @@ function cssnext(string, options) {
7070
if (fs && fs.readFile) {
7171
// @import
7272
if (options.import !== false) {
73-
postcss.use(require("postcss-import")(
73+
const plugin = require("postcss-import")(
7474
typeof options.import === "object"
7575
? {...options.import}
7676
: undefined
7777
)
78-
)
78+
plugin.postcssPlugin = "cssnext"
79+
postcss.use(plugin)
7980
}
8081

8182
// url() adjustements
8283
if (options.url !== false) {
83-
postcss.use(require("postcss-url")(
84+
const plugin = require("postcss-url")(
8485
typeof options.url === "object"
8586
? {...options.url}
8687
: undefined
8788
)
88-
)
89+
plugin.postcssPlugin = "cssnext"
90+
postcss.use(plugin)
8991
}
9092
}
9193

@@ -114,12 +116,13 @@ function cssnext(string, options) {
114116
)
115117
)
116118
) {
117-
postcss.use(cssnext.features[key](
119+
const plugin = cssnext.features[key](
118120
typeof features[key] === "object"
119121
? {...features[key]}
120122
: undefined
121123
)
122-
)
124+
plugin.postcssPlugin = "cssnext"
125+
postcss.use(plugin)
123126
}
124127
})
125128

0 commit comments

Comments
 (0)