css3实现动画对号选择按钮

html

class="icon-span" :class="{'icon-span-select' : isShow}">i>

css

//对号样式
.icon-span{
  display: inline-block;
  background-color: #fff;
  border-radius: 100%;
  border: 1px solid #ccc;
  position: relative;
  width: 20px;
  height: 20px;
  vertical-align: middle;
}
.icon-span::after{
  border: 2px solid transparent;
  border-left: 0;
  border-top: 0;
  content: " ";
  top: 3px;
  left: 6px;
  position: absolute;
  width: 4px;
  height: 8px;
  -webkit-transform: rotate(45deg) scale(0);
  transform: rotate(45deg) scale(0);
  -webkit-transition: -webkit-transform .2s;
  transition: -webkit-transform .2s;
  transition: transform .2s;
  transition: transform .2s, -webkit-transform .2s;
}
.icon-span-select{
  background-color: $color-primary;
  border-color: $color-primary;
}
.icon-span-select::after{
  border-color: #fff;
  -webkit-transform: rotate(45deg) scale(1);
  transform: rotate(45deg) scale(1);
}

效果
css3实现动画对号选择按钮_第1张图片

你可能感兴趣的:(css样式)