(CSS) Better to animate via 'keyframes' or 'transition'?
As a career visual designer who likes to dabble in web programming -- and began the process of "catching up" to today's advancements after 4-5 years away from the programming side of things -- I was ecstatic to learn that CSS-only animations are now a thing.
Here is the basic method I researched and already began employing :
a:hover {
animation: links .3s 1;
filter: brightness(125%);
}
@keyframes links {
from { filter: brightness(100%); }
to { filter: brightness(125%); }
}
However, I just this morning came across this random bit of someone else's code :
a {
transition: opacity 3s;
}
a:hover {
opacity: .8;
}
As much as the first solution works, the second seems to require way less code.
So the question becomes, if I wanted every <a> tag to react on mouseover via a short 3s animation (using either 'opacity' or 'filter:brightness') how would I go about it in 2018... keyframes, or transition? Or is the question faulty to begin with?
Thanks!
