File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,13 @@ module.exports = function (options) {
8
8
if ( ! / \s + $ / . test ( prefix ) ) prefix += ' '
9
9
return function ( root ) {
10
10
root . walkRules ( function ( rule ) {
11
+ if ( rule . parent && rule . parent . name == 'keyframes' ) {
12
+ return
13
+ }
14
+
11
15
rule . selectors = rule . selectors . map ( function ( selector ) {
12
16
if ( options . exclude && ~ options . exclude . indexOf ( selector ) ) {
13
- return selector ;
17
+ return selector
14
18
}
15
19
return prefix + selector
16
20
} )
Original file line number Diff line number Diff line change @@ -31,6 +31,15 @@ it('should avoid prefixing excluded selectors', function () {
31
31
assert ( ~ out . indexOf ( '.hello .a' ) )
32
32
assert ( ~ out . indexOf ( '.hello .b' ) )
33
33
assert ( ~ out . indexOf ( '.hello .c' ) )
34
- assert ( out . indexOf ( '.hello body' ) )
35
- assert ( out . indexOf ( '.hello .a *:not(.b)' ) )
34
+ assert ( ! ~ out . indexOf ( '.hello body' ) )
35
+ assert ( ! ~ out . indexOf ( '.hello .a *:not(.b)' ) )
36
+ } )
37
+
38
+ it ( 'should skip @keyframes selectors' , function ( ) {
39
+ var out = postcss ( ) . use ( prefix ( {
40
+ prefix : '.hello '
41
+ } ) ) . process ( '@keyframes anim {from {} to {}}' ) . css
42
+
43
+ assert ( ! ~ out . indexOf ( '.hello from' ) )
44
+ assert ( ! ~ out . indexOf ( '.hello to' ) )
36
45
} )
You can’t perform that action at this time.
0 commit comments