Update _mixins.sass

This commit is contained in:
Andros Fenollosa 2020-09-03 12:21:59 +02:00 committed by GitHub
parent 21932d9be3
commit b2817bb569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -153,3 +153,22 @@
margin-left: 0 margin-left: 0
&:last-child &:last-child
margin-right: 0 margin-right: 0
/*
* Create animation from a horizontal sprite sheet
*
* Examples: @include animationSpriteSheet(6, "../img/sprite.png", 1.5s)
*/
@mixin animationSpriteSheet($steps, $image, $speed: 1s, $iteration: infinite)
$id: unique-id()
@keyframes #{$id}
100%
background-position-x: calc(#{$steps} * -100%)
animation:
name: $id
duration: $speed
iteration-count: $iteration
timing-function: steps(#{$steps})
background:
image: url(#{$image})
size: calc(#{$steps} * 100%) auto