question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Empty @keyframes declaration is removed in production mode

See original GitHub issue
import { 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
michal-perlakowskicommented, Aug 19, 2021

@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?

0reactions
Andaristcommented, Dec 10, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found