wilsonzlin / minify-html

Extremely fast and smart HTML + JS + CSS minifier, available for Rust, Deno, Java, Node.js, Python, Ruby, and WASM
MIT License
810 stars 36 forks source link

Minify transform properties breaks animations #173

Open oscarotero opened 6 months ago

oscarotero commented 6 months ago

I have the following css code:

@keyframes firecircle {
    0% {
      transform: translateY(0) scale(1);
    }

    100% {
      transform: translateY(-11em) scale(0);
    }
  }

That is minified to:

@keyframes firecircle{0%{transform:matrix(1,0,0,1,0,0)}to{transform:translateY(-11em)scale(0)}}

As you can see, the value in the first step is transformed to a matrix and the animation no longer works.

This happens after updating to the latest version (0.15.0). Before that, I was using 0.11.1 and it worked fine.

wilsonzlin commented 6 months ago

Thanks for raising. This is likely due to the migration to lightningcss. Are you able to take a look upstream to see if there's any config or issue related to this? I'll investigate later as well.

oscarotero commented 6 months ago

Thanks @wilsonzlin Okay, I can see this issue is already filed in https://github.com/parcel-bundler/lightningcss/issues/288 I hope they fix it soon, or at least allow to customize the behavior.

wilsonzlin commented 6 months ago

Thanks for finding the issue, I'll keep track of it.

oscarotero commented 3 weeks ago

Hi. Just want to let you know that this bug seems to be fixed by lightningcss.