Localized @keyframes support
iharuya
The ability to define and apply keyframes in a more localized manner, instead of using the config file globally.
This feature aims to enhance the developer experience by allowing for more modular and encapsulated animation definitions within individual components.
The current approach of defining animations globally can lead to clutter and challenges in maintaining a clean codebase, especially in larger projects. By enabling localized keyframe definitions, developers can create more maintainable, cleaner codebases. This approach aligns with the principles of separation of concerns and component-based architecture, leading to improved code readability and ease of maintenance.
I've noticed that CSS modules, Emotion, Linaria, and Vanilla-Extract each provide their approaches to solving this issue. Similarly, I believe PandaCSS could benefit from adopting a similar strategy or, if I may suggest, the following interface could be a valuable addition:
```javascript
const className = css({
animation: {
keyframe: { "0%": {...}, "100%": {...} },
duration: "1s",
...
}
})}
```