File tree Expand file tree Collapse file tree 2 files changed +32
-1
lines changed
Expand file tree Collapse file tree 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", () => {
9090 expect ( purgedCSS . includes ( "99.9%" ) ) . toBe ( true ) ;
9191 } ) ;
9292} ) ;
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 {
439439 if (
440440 node . parent &&
441441 isPostCSSAtRule ( node . parent ) &&
442- node . parent . name === "keyframes"
442+ node . parent . name . endsWith ( "keyframes" )
443443 ) {
444444 return ;
445445 }
You can’t perform that action at this time.
0 commit comments