I have different views in my page that each have keyframe animations. Each section is shown or hidden by media queries.
Let's say theoretically I am pulling in a separate CSS stylesheet or that I have some limitations to the CSS. If I have two keyframe style rules with the same name "fadein" in this case, will I run into any issues? The last one declared wins correct? Or are style rules nested in a media query treated differently?
@media (min-width: 0px) {
@keyframes fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
}
@media (min-width: 800px) {
@keyframes fadein {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
}
Is there a way to get a keyframe rule by name or id? Is the keyframe name an id?
In other words, you can use document.getElementById("myElement") to get the element using JavaScript but for keyframes is there a method? How does it work when two keyframe rules have the same name?