Skip to content

Commit a51dc1b

Browse files
Postcss 8 (#16)
1 parent 40b9e67 commit a51dc1b

File tree

4 files changed

+18
-11
lines changed

4 files changed

+18
-11
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
language: node_js
22
node_js:
3-
- "4"
4-
- "6"
53
- "8"
64
- "10"
5+
- "12"
76
- "node"

index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,19 @@
33
const postcss = require('postcss')
44
const Selector = require('postcss-selector-parser')
55

6-
module.exports = postcss.plugin('postcss-prefix', postcssPrefix)
6+
module.exports = postcssPrefix
7+
postcssPrefix.postcss = true
78

89
function postcssPrefix (prefix, options) {
910
options = options || {}
1011

11-
return function walk (root) {
12-
root.walkRules(function (rule) {
12+
return {
13+
postcssPlugin: 'postcss-prefix',
14+
Rule: function (rule) {
1315
const selector = Selector(transformSelectors)
1416
.processSync(rule.selector)
1517
rule.selector = selector
16-
})
18+
}
1719
}
1820

1921
function transformSelectors (selectors) {

package.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
{
22
"name": "postcss-prefix",
3+
"description": "Replace `:host` elements with a prefix of your choosing",
34
"version": "2.2.0",
4-
"license": "MIT",
5-
"repository": "stackcss/postcss-prefix",
5+
"author": "Hugh Kennedy <[email protected]>",
6+
"bugs": "https://github.com/stackcss/postcss-prefix/issues",
67
"dependencies": {
7-
"postcss": "^5.0.8",
8-
"postcss-selector-parser": "^4.0.0"
8+
"postcss-selector-parser": "^6.0.2"
99
},
1010
"devDependencies": {
11-
"tape": "^4.2.1"
11+
"postcss": "^8.0.5",
12+
"tape": "^5.0.1"
1213
},
14+
"homepage": "https://github.com/stackcss/postcss-prefix",
15+
"license": "MIT",
16+
"main": "index.js",
17+
"repository": "stackcss/postcss-prefix",
1318
"scripts": {
1419
"test": "tape test/index.js"
1520
}

0 commit comments

Comments
 (0)