Purgecss: Rewriting css keyframes

Created on 12 Mar 2018  路  1Comment  路  Source: FullHuman/purgecss

Hi. I am finding that purgecss is not outputting certain individual css keyframes if they have decimal places in the values - even if the css is actually in use. This is probably a bit of an edge case (I have a css looping feature that fades in/out forever, that uses sass for calculations, hence the decimal places).

A simple example would be:

@keyframes xxx {
  0% {opacity: 0;}
  99.9% {opacity: 1;}
}

is output by purgecss as follows (the 99.9% keyframe is missing):

@keyframes xxx {
  0% {
    opacity: 0; } }

BUT using integers is ok:

@keyframes yyy {
  0% {opacity: 0;}
  99% {opacity: 1;}
}

outputs as expected...

@keyframes yyy {
  0% {
    opacity: 0; }
  99% {
    opacity: 1; } }

I hope there is a way around this. I'm not sure why purgecss is processing these - I'm pretty certain that it's not another module that is doing this (I've spent a while narrowing it down). Any ideas please?

bug

Most helpful comment

Thanks for reporting this issue.
It should be fixed with v0.21.0

>All comments

Thanks for reporting this issue.
It should be fixed with v0.21.0

Was this page helpful?
0 / 5 - 0 ratings