File tree 2 files changed +32
-1
lines changed
2 files changed +32
-1
lines changed Original file line number Diff line number Diff line change @@ -90,3 +90,34 @@ describe("keep keyframe decimals", () => {
90
90
expect ( purgedCSS . includes ( "99.9%" ) ) . toBe ( true ) ;
91
91
} ) ;
92
92
} ) ;
93
+
94
+ describe ( "keep webkit keyframe decimals" , ( ) => {
95
+ let purgedCSS : string ;
96
+ beforeAll ( async ( ) => {
97
+ const resultsPurge = await new PurgeCSS ( ) . purge ( {
98
+ content : [
99
+ {
100
+ raw : '<div class="xx"></div>' ,
101
+ extension : "html" ,
102
+ } ,
103
+ ] ,
104
+ css : [
105
+ {
106
+ raw : `
107
+ @-webkit-keyframes xxx {
108
+ 0% {opacity: 0;}
109
+ 99.9% {opacity: 1;}
110
+ }
111
+ .xx { animation: xxx 200ms linear both }
112
+ ` ,
113
+ } ,
114
+ ] ,
115
+ keyframes : false ,
116
+ } ) ;
117
+ purgedCSS = resultsPurge [ 0 ] . css ;
118
+ } ) ;
119
+
120
+ it ( "keeps `99.9%`" , ( ) => {
121
+ expect ( purgedCSS . includes ( "99.9%" ) ) . toBe ( true ) ;
122
+ } ) ;
123
+ } ) ;
Original file line number Diff line number Diff line change @@ -439,7 +439,7 @@ class PurgeCSS {
439
439
if (
440
440
node . parent &&
441
441
isPostCSSAtRule ( node . parent ) &&
442
- node . parent . name === "keyframes"
442
+ node . parent . name . endsWith ( "keyframes" )
443
443
) {
444
444
return ;
445
445
}
You can’t perform that action at this time.
0 commit comments