Last active
August 29, 2015 14:16
-
-
Save AllThingsSmitty/1ba35b21e3185e46d6ec to your computer and use it in GitHub Desktop.
Nested @keyframe rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* old Sass 3.3 */ | |
/* nest keyframe rules inside their modules with `@at-root` */ | |
.bunny { | |
animation: hop 2s ease-in-out infinite, | |
move 6s ease-out forwards; | |
@at-root { | |
@keyframes hop { | |
50% { transform: translateY(40px); } | |
} | |
@keyframes move { | |
100% { left: 400px; } | |
} | |
} | |
} | |
/* new Sass 3.4 */ | |
/* nest keyframe rules like regular Sass rules */ | |
.bunny { | |
animation: hop 2s ease-in-out infinite, | |
move 6s ease-out forwards; | |
@keyframes hop { | |
50% { transform: translateY(40px); } | |
} | |
@keyframes move { | |
100% { left: 400px; } | |
} | |
} | |
/* Sass outputs keyframe rules at the root level */ | |
.bunny { | |
animation: hop 2s ease-in-out infinite, | |
move 6s ease-out forwards; | |
} | |
@keyframes hop { | |
50% { | |
transform: translateY(40px); | |
} | |
} | |
@keyframes move { | |
100% { | |
left: 400px; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment