Skip to content
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

Variable opacity states for fade animations #1314

Open
sjInside opened this issue Jun 22, 2021 · 2 comments
Open

Variable opacity states for fade animations #1314

sjInside opened this issue Jun 22, 2021 · 2 comments

Comments

@sjInside
Copy link

sjInside commented Jun 22, 2021

Is your feature request related to a problem? Please describe.
Hi, when I am using fade animations (e. g. fadeInLeft) I whould like to be able to specify the boundaries of my opacity.

Describe the solution you'd like
In addition to the existing CSS variables you could add variables for the opacity set by the animations.

Something like:

@keyframes fadeInLeft {
   from {
    opacity: var(--fade-opacity-start, 0);
    transform: translate3d(-100%, 0, 0);
  }

  to {
    opacity: var(--fade-opacity-end, 1);
    transform: translate3d(0, 0, 0);
  }
}

and then

.animated-element{
  --fade-opacity-end: 0.5;
  animation-name: fadeInLeft;
}

Additional context
Sometimes you have the situation when you don't want to fully fade an element in or out. Without this feature you can't use opacity on animated elements at all since the keyframes overwrite any opacity value during the animation.

@pomodory
Copy link

@-webkit-keyframes fadeInUp {
from {
opacity: 0;
-webkit-transform: translate3d(0, 100%, 0);
transform: translate3d(0, 100%, 0);
}

to {
opacity: 1;
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
}
}

we also want to specify transform translate3d(0, 100%, 0) -> translate3d(0, 50%, 0)

@warengonzaga
Copy link
Member

Thanks for the suggestion guys, I'll work on it! 🚀😁
Can you assign this to me @eltonmesquita?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
V5.0.0
To do
Development

No branches or pull requests

4 participants