Skip to content

Inline css shorthand for animation parameters not working properly #4227

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

Closed
audiomancer opened this issue Jan 7, 2020 · 2 comments
Closed

Comments

@audiomancer
Copy link

Recently, when I was trying to dynamically control css animation parameters from js (the simplest way is to use inline css and interpolate js into it using curly braces), I found that the animation parameters shortand is not working, when placed inline. It works only when it's in the <style> section, whereas separating animation parameters to several lines works as it normally should.

Take a look at those two components in the repl below:
https://svelte.dev/repl/9dcabd5569cb4853b06a8d02d9392fc3?version=3.16.7

Inline shorthand for animation parameters should work as is working in pure css / js like e.g. here:
https://stackoverflow.com/questions/40784938/is-it-possible-to-apply-css-transitions-inline

Regards!

@PatrickG
Copy link
Member

PatrickG commented Jan 8, 2020

That is, because the name of the animation changed in the build process to something like svelte-1ympdso-blink.

@Conduitry
Copy link
Member

Yup, if you don't want an animation name scoped to the component, you can prefix its name with -global-, at which point using it from another component works again. This was added in #607 but it was never documented other than in the changelog. We've left #3352 open for documenting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants