Skip to content

Commit

Permalink
feat: add ".is-paused" mui-series modifier to pause the queue
Browse files Browse the repository at this point in the history
As `.is-paused` is not set at the animation definition, Safari handle it correctly and can play and pause the animation.

See #97 (comment)
  • Loading branch information
ncoden committed May 6, 2018
1 parent 13bb2de commit e274752
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ $motion-ui-settings: (
hinge-and-fade: true,
scale-and-fade: true,
spin-and-fade: true,
pause-queue-class: 'is-paused',
activate-queue-class: 'is-animating'
);
```
Expand Down
1 change: 1 addition & 0 deletions docs/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ $motion-ui-settings: (
hinge-and-fade: true,
scale-and-fade: true,
spin-and-fade: true,
pause-queue-class: 'is-paused',
activate-queue-class: 'is-animating'
);
```
1 change: 1 addition & 0 deletions src/_settings.scss
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ $motion-ui-settings: (
hinge-and-fade: true,
scale-and-fade: true,
spin-and-fade: true,
pause-queue-class: 'is-paused',
activate-queue-class: 'is-animating',
) !default;
6 changes: 6 additions & 0 deletions src/util/_series.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,10 @@ $-mui-queue: ();
animation-delay: $actual-delay;
animation-duration: $duration;
}

// Pause the animation
// This was the behavior before v1.3.0. See https://git.io/motion-ui-97
.#{map-get($motion-ui-settings, pause-queue-class)} & {
animation-play-state: paused;
}
}

0 comments on commit e274752

Please sign in to comment.