Skip to content

Commit 7ab029c

Browse files
Update to postcss v7 and postcss-preset-env (#7)
1 parent f73c0ef commit 7ab029c

File tree

6 files changed

+26
-23
lines changed

6 files changed

+26
-23
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ coverage/
33
tmp/
44
npm-debug.log*
55
.DS_Store
6+
.nyc_output

.travis.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
language: node_js
12
node_js:
23
- "stable"
3-
- "4"
4-
sudo: false
5-
language: node_js
4+
- "12"
5+
- "10"
6+
- "8"
67
script: "npm run test:cov"
78
after_script: "npm i -g codecov.io && cat ./coverage/lcov.info | codecov"

fixtures/basic-out.css

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
hello, world {
2-
-webkit-transform: translate(0, 0);
3-
transform: translate(0, 0);
1+
:root {
2+
--mainColor: rgba(18,52,86,0.47059);
3+
}
4+
5+
body {
6+
color: rgba(18,52,86,0.47059);
7+
color: var(--mainColor);
48
}

fixtures/basic.css

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
hello, world {
2-
transform: translate(0, 0);
1+
:root {
2+
--mainColor: #12345678;
3+
}
4+
5+
body {
6+
color: var(--mainColor);
37
}

index.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
const postcss = require('postcss')
2-
const cssnext = require('postcss-cssnext')
2+
const cssnext = require('postcss-preset-env')
33
const imports = require('postcss-import')
44
const xtend = require('xtend')
55

6-
// Patch CSSNext features map to ensure Node v4 support
7-
const features = require('postcss-cssnext/lib/features').default
8-
features.calc = function calc (options) {
9-
return require('postcss-calc')(options)
10-
}
11-
126
module.exports = transform
137

148
function transform (filename, source, options, done) {

package.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"scripts": {
77
"deps": "dependency-check . && dependency-check . --extra --no-dev",
88
"test": "standard && npm run deps && NODE_ENV=test node test",
9-
"test:cov": "standard && npm run deps && NODE_ENV=test istanbul cover test.js"
9+
"test:cov": "standard && npm run deps && NODE_ENV=test nyc node test.js"
1010
},
1111
"repository": "stackcss/sheetify-cssnext",
1212
"keywords": [
@@ -22,17 +22,16 @@
2222
],
2323
"license": "MIT",
2424
"dependencies": {
25-
"postcss": "^6.0.17",
26-
"postcss-calc": "6.0.1",
27-
"postcss-cssnext": "^3.1.0",
28-
"postcss-import": "^11.0.0",
25+
"postcss": "^7.0.17",
26+
"postcss-import": "^12.0.1",
27+
"postcss-preset-env": "^6.7.0",
2928
"xtend": "^4.0.0"
3029
},
3130
"devDependencies": {
3231
"dependency-check": "^2.5.1",
33-
"istanbul": "^0.4.1",
34-
"standard": "^10.0.3",
35-
"tape": "^4.2.1"
32+
"nyc": "^14.1.1",
33+
"standard": "^14.3.4",
34+
"tape": "^5.0.1"
3635
},
3736
"engines": {
3837
"node": ">= 4"

0 commit comments

Comments
 (0)