You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: CSS: @value replacement in keyframes/animation produces broken output #15612
Emmm, latest webpack emits a warning for re-declaration while the generated name is incorrect.
If we treat at-value and at-keyframes as variable declarations, this is actually correct output.
@value animName: pulseAnim; // <- first declaration
.anim {
animation: animName 2s linear; // <- deref first declaration here
}
@keyframes animName { // <- declare the second one, the first declaration is shadowed
from { opacity: 0; }
}
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 @value for typical cases work for us, and thought it worth reporting - primarily because of the inconsistency with webpack.
Activity
Knagis commentedon Sep 10, 2026
Expected Behavior... Needs to be aligned with webpack.
Likely to keep consistency with how @value are used (not hashed) in selectors:
intellild commentedon Sep 10, 2026
I checked
css-loaderand the name is hashed.localIdentName: "[path][name]__[local]--[hash:base64:5]"I will align with
css-loaderfirst.Knagis commentedon Sep 10, 2026
css-loader is deprecated now, and it doesn't even support values in selectors that webpack and rspack native css support does support.
intellild commentedon Sep 10, 2026
Emmm, latest webpack emits a warning for re-declaration while the generated name is incorrect.
If we treat at-value and at-keyframes as variable declarations, this is actually correct output.
intellild commentedon Sep 10, 2026
If you want to keep the animation name, at-value is not needed. Just set
parser['css/module'].animation = falsehttps://rspack.rs/config/module-parser#cssautoanimation
Knagis commentedon Sep 10, 2026
@intellild If the logic that
@keyframesoverride@valueholds (why not, seems logical) then would it be expected that forthis produces the same output - the animation reference uses the first declaration, not the second.
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
@valuefor typical cases work for us, and thought it worth reporting - primarily because of the inconsistency with webpack.intellild commentedon Sep 10, 2026
Thanks for reporting, this I will add a warning