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
When working with CSS Modules, animation names are automatically localized just like class names. While this localization is generally desired, it creates significant friction when trying to use animations from third-party libraries or when sharing animations across components.
Currently, there's no clean way to reference global animation names in CSS Modules. The existing approaches all have issues:
/* ❌ Doesn't work - causes parsing error: "CssSyntaxError: Double colon" */
.component {
animation::global(fadeIn) 0.5s ease-in;
}
/* ❌ Also doesn't work - same parsing error */
.component {
animation-name::global(fadeIn);
}
/* ❌ Doesn't work as it is not pure and also does not allow using global animations */@keyframes:global(fadeIn) {
}
This becomes especially problematic when:
Using popular animation libraries (Animate.css, animate-sass, etc.)
Working with design systems that define animations at a global level
Sharing animations between components
Using micro-frontends where animations are defined in a shared global scope
Proposed Solution
Add support for a clean global() function specifically for animation names:
When working with CSS Modules, animation names are automatically localized just like class names. While this localization is generally desired, it creates significant friction when trying to use animations from third-party libraries or when sharing animations across components.
Currently, there's no clean way to reference global animation names in CSS Modules. The existing approaches all have issues:
This becomes especially problematic when:
Proposed Solution
Add support for a clean
global()
function specifically for animation names:This would:
:global
for selectors but specifically for animation propertiesTechnical Details
The implementation would need to:
animation
andanimation-name
properties specificallyglobal()
function in these contextsglobal()
wrapper while preventing the animation name from being localizedThe text was updated successfully, but these errors were encountered: