Transitions

Each transition has its own mixin, with multiple parameters that can customize the details of the effect. To create a transition class, just @include the mixin inside a class. Motion UI will create the necessary boilerplate for you.

Here’s a basic fade in class. The first parameter of every transition mixin is a state, which is either in or out. In transitions reveal elements, while out transitions hide them.

.fade-in {
  @include mui-fade(in);
}

Here’s what the CSS looks like.

.fade-in.mui-enter {
  opacity: 0;
  transition-property: opacity; }

.fade-in.mui-enter.mui-enter-active {
  opacity: 1; }

The last three parameters of every transition mixin are the same: $duration, which sets the speed of the effect; $timing, which adjusts the easing; and $delay, which adds a delay before the effect starts.

.fade-in {
  // A long, long fade
  @include mui-fade(in, $duration: 10s);
}

Mixins

mui-fade()

Creates a fade transition by adjusting the opacity of the element.

Parameters:

mui-hinge()

Creates a hinge transition by rotating the element.

Parameters:

mui-slide()

Creates a sliding transition by translating the element horizontally or vertically.

Parameters:

mui-spin()

Creates a spinning transition by rotating the element. The turn unit is used to specify how far to rotate. 1turn is equal to a 360-degree spin.

Parameters:

mui-zoom()

Creates a scaling transition. A scale of 1 means the element is the same size. Larger numbers make the element bigger, while numbers less than 1 make the element smaller.

Parameters: