-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty @keyframes declaration is removed in production mode #2392
Comments
If a tree falls in a forest and no one is around to hear it, does it make a sound? If animation is not animating anything - did it even happen? 😉 Could you describe your use case? In dev we are using a custom fork of the Stylis' rulesheet plugin which injects empty rules (from what I recall this mainly is done to make the cache key discoverable by emotion/packages/cache/src/index.js Lines 145 to 151 in 5b885ee
In this situation the element has an empty return but still has value that we use to inject this rule in development.
In production, we are using the official |
@Andarist Material-UI uses empty animations to detect autofill in text fields (see the linked issue). |
Perhaps this should be fixed in Stylis - I opened an issue there: thysultan/stylis#265. |
The linked issue has no context for this technique. Could you expand on that? |
@Andarist You apply the animation to the |
There are two links of the approach from third-parties in mui/material-ui#14427 (comment). |
@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? |
Fixes emotion-js#2392.
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. |
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.0The text was updated successfully, but these errors were encountered: