Empty @keyframes declaration is removed in production mode
See original GitHub issueimport { Global } from '@emotion/react';
function App() {
return (
<div>
<Global
styles={{
'@keyframes test-animation': {},
}}
/>
<div
id="test-el"
style={{
animationName: 'test-animation',
animationDuration: '10ms',
}}
onAnimationStart={(event) => {
console.log(event.animationName);
}}
/>
</div>
);
}
export default App;
Expected behavior: 'test-animation'
is logged in console. This works fine in development mode, but not in production.
Demo repository: https://github.com/michal-perlakowski/emotion-test
This is causing a bug in Material-UI.
Environment information:
react
version: 17.0.2@emotion/react
version: 11.4.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
Top Results From Across the Web
keyframes - CSS: Cascading Style Sheets - MDN Web Docs
The @keyframes CSS at-rule controls the intermediate steps in a CSS animation sequence by defining styles for keyframes (or waypoints) along ...
Read more >CSS Keyframe animation not removing display block
I need it to go to display none . Html: <div id="searchsection" class="btnlist btnlist-top blank" style= ...
Read more >CSS Animations Level 1 - W3C
Abstract. This CSS module describes a way for authors to animate the values of CSS properties over time, using keyframes.
Read more >How to use frames and keyframes in Animate - Adobe Support
Delete keyframe Select the keyframe and select Edit > Timeline > Clear Keyframe, or right-click (Windows) or Control‑click (Macintosh) the ...
Read more >The CSS animation-fill-mode Property, Explained
There's an animation-delay of 3s (three seconds) and an extra style to the @keyframes declaration that rotates the car (to make it look...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Andarist Stylis’ owner hasn’t replied to the issue and has been inactive on GitHub in general for a few months. Maybe we should fix this in emotion?
A new version of Stylis has been published - we are going to bump the declared dependency range in Emotion packages sometime later but you should be able to already leverage the fix by pruning Stylis from your lock file and reinstalling packages.