Sha256: 9da83e97716f80a15073180a4432862ba197a6cb2312c5e601503f5e82004fe5
Contents?: true
Size: 920 Bytes
Versions: 8
Compression:
Stored size: 920 Bytes
Contents
/// Creates a spinning animation. /// @param {Keyword} $direction [null] - Direction to spin. Should be `cw` (clockwise) or `ccw` (counterclockwise). By default `cw` and `ccw` for `in` and `out` states respectively. /// @param {Number} $amount [360deg] - Amount to spin. Can be any CSS angle unit. /// @return {Map} A keyframes map that can be used with the `generate-keyframes()` mixin. @function spin( $state: in, $direction: null, $amount: 1turn ) { $start: 0; $end: 0; $direction: if($direction != null, $direction, if($state == in, cw, ccw)); @if $state == in { $start: if($direction == ccw, $amount, $amount * -1); $end: 0; } @else { $start: 0; $end: if($direction == ccw, $amount * -1, $amount); } $keyframes: ( name: -mui-string-safe('spin-#{$direction}-#{$amount}'), 0: (transform: rotate($start)), 100: (transform: rotate($end)), ); @return $keyframes; }
Version data entries
8 entries across 8 versions & 2 rubygems