scss mixin用于缓动动画

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了scss mixin用于缓动动画相关的知识,希望对你有一定的参考价值。

In Sass, you can set-up `mixin` functions which define a set of styles.  That mixin can be called elsewhere in your SCSS stylesheet using `@include` to apply that mixin's styling.

In this case, we're setting up a mixin which will handle the application of a transition effect wherever it's called.
@mixin easeOut {
  transition: all 0.5s ease-out;
}

a {
  padding: 0.4rem;
  
  // Call the mixin when an anchor element is hovered over
  &:hover {
    color: $secondary-color;
    @include easeOut;
  }
}

以上是关于scss mixin用于缓动动画的主要内容,如果未能解决你的问题,请参考以下文章

scss 用于CSS3动画的Sass Mixin

scss 用于CSS3动画的Sass Mixin

scss 动画链接[Mixin]

scss 关键帧CSS动画Mixin

scss 动画Mixins

scss Sass - Mixins:动画和关键帧