Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: reduceIdents: false not working #1460

Open
argyleink opened this issue Dec 15, 2022 · 2 comments
Open

[Bug]: reduceIdents: false not working #1460

argyleink opened this issue Dec 15, 2022 · 2 comments

Comments

@argyleink
Copy link

Describe the bug

I have some keyframes being transformed into a broken state:

@keyframes author-scroll-effect {
  exit -5%, 0% {
    transform: scale(1);
  }
  exit 50%, exit 100% {
    transform: scale(0.8) translateY(10vh);
  }
}

becoming

@keyframes author-scroll-effect {
  exit -5%, 0% {
    transform: scale(1);
  }
  exit 50%, exit to {
    transform: scale(0.8) translateY(10vh);
  }
}

I'm pretty savvy with build tools and nothing I did could remove that transform, makes me think it's got a bug? or let me know how I'm holding it wrong. it's strange too because i'm not passing a preset (well, i wasnt at first but i've tried passing presets) and the only way i can get rid of the transform is by using the "lite" preset. This is odd because the default preset shouldnt even include this transform..?

Screen Shot 2022-12-15 at 3 29 31 PM

I was hoping this simple config would do it, but i've tried all the presets and stuff.

cssnano({
  reduceIdents: false
})

cssnano({
  reduceIdents: { keyframes: false }
})

Expected behaviour

I expected being able to disable the transform but found I could only do it by heavily downgrading the optimizations to the lite preset.

Steps to reproduce

  1. use latest node
  2. use latest cssnano and postcss
  3. try and remove the reduceIdents transform

Version

latest

Preset

default

Environment

System:
    OS: macOS 12.6.1
    CPU: (16) x64 Intel(R) Xeon(R) W-2140B CPU @ 3.20GHz
    Memory: 476.42 MB / 64.00 GB
    Shell: 3.2.57 - /bin/bash

Package details

cssnano and postcss

Additional context

No response

@ludofischer
Copy link
Collaborator

If the broken transformation is 100% changing to to, I don't think the reduce-idents plugin is responsible. reduce-idents should not touch anything besides custom identifiers (in this case, it should shorten the keyframe name), the culprit is likely a different plugin.

@johannesodland
Copy link
Contributor

Ran into the same issue, and disabling minifySelectors solved the problem.

There's a line in minify-selectors that replaces 100% with to regardless of whether to is allowed in the keyframe-selector.

This breaks keyframe-selectors that follow the pattern <timeline-range-name> <percentage> as extended in Scroll-driven Animations

With Chrome 115 supporting scroll-driven animations, this issue will become more prevalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants