Skip to content

Instantly share code, notes, and snippets.

@kabilashgit
Last active March 20, 2019 11:33
Show Gist options
  • Save kabilashgit/90c89d5b973d337522a525ddad19ac01 to your computer and use it in GitHub Desktop.
Save kabilashgit/90c89d5b973d337522a525ddad19ac01 to your computer and use it in GitHub Desktop.
Mixin to create css animation keyframes

/* Author : Manikandan K */

mixin to create css animation keyframes

@mixin keyframes($animation-name) {
  @-webkit-keyframes #{$animation-name} {
    @content;
  }
  @-moz-keyframes #{$animation-name} {
    @content;
  }
  @keyframes #{$animation-name} {
    @content;
  }
}

usage in .scss

@include keyframes(animName){
    100% { 
        height: 80vh; 
    }
}

output in .css

@-webkit-keyframes animName {
  100% {
    height: 80vh;
  }
}
@-moz-keyframes animName {
  100% {
    height: 80vh;
  }
}
@keyframes animName {
  100% {
    height: 80vh;
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment