astroturfcss / astroturf

Better Styling through Compiling: CSS-in-JS for those that want it all.
https://astroturfcss.github.io/astroturf/
MIT License
2.28k stars 60 forks source link

local keyframes broken (v1.0.0-beta.15) #657

Closed mikestopcontinues closed 3 years ago

mikestopcontinues commented 3 years ago

I'm trying to leverage local keyframes, but the transformation doesn't seem to be working properly. It's scoping the keyframe name to Book-bookCls_tilt__3ayd_, but transforming the animation reference to :local(tilt)...

Here's the source:

const bookCls = css`
  animation: 0.5s ease-in-out 0.5s tilt;

  @keyframes tilt {
    0% {
      transform: rotateY(-15deg);
    }
    100% {
      transform: rotateY(-30deg);
    }
  }
`;

And the output:

.Book-bookCls_cls1__1rtme { /*!*/ }

.Book-bookCls_cls2__28yv9 {
-webkit-animation: 0.5s ease-in-out 0.5s :local(tilt);
animation: 0.5s ease-in-out 0.5s :local(tilt);

@-webkit-keyframes Book-bookCls_tilt__3ayd_ {
0% {
transform: rotateY(-15deg);
}
50% {
transform: rotateY(-30deg);
}
100% {
transform: rotateY(-15deg);
}
}
}

@keyframes Book-bookCls_tilt__3ayd_ {
0% {
transform: rotateY(-15deg);
}
50% {
transform: rotateY(-30deg);
}
100% {
transform: rotateY(-15deg);
}
}
jquense commented 3 years ago

hmm astroturf isn't doing any these transformations, css-modules is. What is your build tool webpack? Maybe the css-loader options changed recently or a bug was introduced...

mikestopcontinues commented 3 years ago

Oh, of course! It might be how NextJS configures css-loader too. I'll take this up the chain.