File tree 1 file changed +18
-17
lines changed
1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change @@ -6,23 +6,24 @@ module.exports = function postcssPrefixSelector(options) {
6
6
? [ ] . concat ( options . includeFiles )
7
7
: [ ] ;
8
8
9
- return function ( root ) {
10
- if (
11
- ignoreFiles . length &&
12
- root . source . input . file &&
13
- isFileInArray ( root . source . input . file , ignoreFiles )
14
- ) {
15
- return ;
16
- }
17
- if (
18
- includeFiles . length &&
19
- root . source . input . file &&
20
- ! isFileInArray ( root . source . input . file , includeFiles )
21
- ) {
22
- return ;
23
- }
9
+ return {
10
+ postcssPlugin : 'postcss-prefix-selector' ,
11
+ Rule ( rule ) {
12
+ if (
13
+ ignoreFiles . length &&
14
+ rule . source . input . file &&
15
+ isFileInArray ( rule . source . input . file , ignoreFiles )
16
+ ) {
17
+ return ;
18
+ }
19
+ if (
20
+ includeFiles . length &&
21
+ rule . source . input . file &&
22
+ ! isFileInArray ( rule . source . input . file , includeFiles )
23
+ ) {
24
+ return ;
25
+ }
24
26
25
- root . walkRules ( ( rule ) => {
26
27
const keyframeRules = [
27
28
'keyframes' ,
28
29
'-webkit-keyframes' ,
@@ -49,7 +50,7 @@ module.exports = function postcssPrefixSelector(options) {
49
50
50
51
return prefixWithSpace + selector ;
51
52
} ) ;
52
- } ) ;
53
+ } ,
53
54
} ;
54
55
} ;
55
56
You can’t perform that action at this time.
0 commit comments