sass用background-image来写1px的边框

@mixin hairBorder($top:#fff,$right:#fff,$foot:#fff,$left:#fff) {
  background-image:
    linear-gradient(180deg, $top, $top 50%, transparent 50%),
    linear-gradient(270deg, $right, $right 50%, transparent 50%),
    linear-gradient(0deg, $foot, $foot 50%, transparent 50%),
    linear-gradient(90deg, $left, $left 50%, transparent 50%);
  background-size: 100% 1PX, 1PX 100%, 100% 1PX, 1PX 100%;
  background-repeat: no-repeat;
  background-position: top, right top, bottom, left top;
}



@include hairBorder(#e9e9e9, #e9e9e9, #e9e9e9, #e9e9e9);

 

posted on 2018-07-17 15:37  道法自然-法力无边  阅读(304)  评论(0编辑  收藏  举报

导航