linear-gradient mixin

@mixin gradientAnimation($start, $end, $transTime) {
  background-size: 100%;
  background-image: $start;
  position: relative;
  z-index: 100;
  &:before {
    background-image: $end;
    content: "";
    display: block;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    width: 100%;
    z-index: -100;
    transition: opacity $transTime;
  }
  &:hover {
    &:before {
      opacity: 1;
    }
  }
}
posted @ 2022-03-11 15:55  SteveYu  阅读(35)  评论(0编辑  收藏  举报