lightningcss
lightningcss copied to clipboard
Support ":global" scope for keyframe names
The CSS Modules documentation mentions the use of :global applied to keyframe names: https://github.com/css-modules/css-modules/blob/master/docs/composition.md#exceptions. This functionality is supported by PostCSS, and the lack of support for it in LightningCSS is disappointing.
Example input:
@keyframes :global(jump) {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
Expected output (jump name saved):
@keyframes jump {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-10px);
}
100% {
transform: translateY(0);
}
}
Current behavior - "ERROR: Unexpected token Colon". Click
I think we probably will not support that syntax, but perhaps via a different one. The reason is that the CSS spec requires an <ident> keyword there, not a selector. See this proposal: https://github.com/css-modules/css-modules/issues/390