postcss-modules icon indicating copy to clipboard operation
postcss-modules copied to clipboard

Animation keyframe name is not always transformed to local scope name

Open ghost opened this issue 5 years ago • 5 comments

Actual: The following input,

@keyframes slideIn {
  0% {
    margin-left: 100%;
  }
  100% {
    margin-left: 0%;
  }
}

.case-1 {
  animation: 2s slideIn;
}

.case-2 {
  animation: slideIn 2s;
}

when using the command, postcss input.css -u postcss-modules -o output.css

generates the following output

@keyframes _slideIn_1329k_1 {
  0% {
    margin-left: 100%;
  }
  100% {
    margin-left: 0%;
  }
}

._case-1_1329k_19 {
  animation: 2s :local(slideIn);
}

._case-2_1329k_27 {
  animation: _slideIn_1329k_1 2s;
}

Expected I would expect the keyframe name to be transformed in both cases.

ghost avatar Jul 27 '18 13:07 ghost

@ben-mckernan sorry, I haven't enough time now :(. If you'll be able to tackle this, PR is welcome!

madyankin avatar Jul 30 '18 04:07 madyankin

Have same bug, looks like problem inside post-css-modules-scope

SuperOleg39 avatar Oct 05 '20 12:10 SuperOleg39

Subscribed to the linked PR, will update the deps when it's merged

madyankin avatar Oct 05 '20 15:10 madyankin

The linked PR is merged, any chance this package can be updated?

mischnic avatar Jan 28 '21 12:01 mischnic

@mischnic will be able to check on the weekend, thanks for pinging me

madyankin avatar Jan 28 '21 13:01 madyankin