Replies: 8 comments
|
Expected Behavior... Needs to be aligned with webpack. Likely to keep consistency with how @value are used (not hashed) in selectors: .anim_hash {
animation: pulseAnim 2s linear;
}
@keyframes pulseAnim {
from { opacity: 0; }
} |
|
I checked .src-index__anim--aDRCe {
animation: 2s linear src-index__pulseAnim--rpbwN;
}
@keyframes src-index__pulseAnim--rpbwN {
0% {
opacity: 0;
}
}I will align with |
|
css-loader is deprecated now, and it doesn't even support values in selectors that webpack and rspack native css support does support. /* input */
@value sel: .globalThing;
sel {
color: blue;
}
/* output */
.XbSZ44YRvgGzLB6rR_A1 {
color: blue;
} |
|
Emmm, latest webpack emits a warning for re-declaration while the generated name is incorrect. |
|
If you want to keep the animation name, at-value is not needed. Just set |
|
@intellild If the logic that @value animName: pulseAnim;
@keyframes animName {
from { opacity: 0; }
}
.anim {
animation: animName 2s linear;
}this produces the same output - the animation reference uses the first declaration, not the second. @keyframes css-modules-value-animation-src_index_css-animName {
from { opacity: 0; }
}
.css-modules-value-animation-src_index_css-anim {
animation: pulseAnim 2s linear;
}Perhaps the better approach is to throw an error when such conflict is encountered to make it explicitly not supported? I personally don't have clear preference, we don't use this case, it was something that i found while making sure |
|
Thanks for reporting, this I will add a warning |
|
Things are a little bit complicated. In this case, if we prefer animation first, the @value imported from "./values.module.css";
.before {
animation: imported 1s linear;
animation-name: imported;
}
@keyframes imported {
from { opacity: 0; }
} |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
System Info
rspack 2.2.3
Details
@valuereplacement foranimation+@keyframesproduce broken output:note - webpack native css also has an issue, though with different output: webpack/webpack#22030
Reproduce link
https://github.com/Knagis/rspack-webpack-css-value-animation
Reproduce Steps
All reactions