• 我的mixin.scss文件


    @mixin text-ellipsis() {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    @mixin text-ellipsis-multi($line) {
      display: -webkit-box;
      overflow: hidden;
      text-overflow: ellipsis;
      -webkit-line-clamp: $line;
      -webkit-box-orient: vertical;
    }
    
    @mixin flex-center($direction: row) {
      display: flex;
      flex-direction: $direction;
      align-items: center;
      justify-content: center;
    }
    
    @mixin box-shadow {
      box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);
    }
    
    @mixin img-wrap($width, $height: $width) {
       $width;
      height: $height;
      flex-shrink: 0;
    
      img {
         100%;
        height: 100%;
      }
    }
    
    @mixin abs-stretch {
      position: absolute;
      left: 0;
      bottom: 0;
      top: 0;
      right: 0;
    }
    
    @mixin abs-center {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
    }
    
    @mixin round($d) {
       $d;
      height: $d;
      border-radius: 50%;
    }
    
    @mixin list($item-width) {
      .list-wrap {
        display: flex;
        flex-wrap: wrap;
        margin: 0 -12px;
    
        .list-item {
           $item-width;
          margin-bottom: 36px;
          padding: 0 12px;
        }
      }
    }
    
    // 定位
    @mixin dw($position, $top, $left) {
      position: $position;
      top: $top;
      left: $left;
    }
    
    // 宽高100%
    @mixin full_wh {
       100%;
      height: 100%;
    }
    
    //宽高
    @mixin wh($width, $height) {
       $width;
      height: $height;
    }
    
    // 宽高一样
    @mixin same-wh($length) {
       $length;
      height: $length;
    }
    
    // 转行内块  宽高
    @mixin inbwh($width, $height) {
      display: inline-block;
       $width;
      height: $height;
    }
    
    // 行高垂直居中 tac水平居中
    @mixin lhtac($lineheight, $center: center) {
      line-height: $lineheight;
      text-align: $center;
    }
    
    // 背景图片地址和大小
    @mixin bgi($url) {
      background-image: url($url);
      background-repeat: no-repeat;
      background-size: 100% 100%;
    }
    
    @mixin borderRadius($radius) {
      -webkit-border-radius: $radius;
      -moz-border-radius: $radius;
      -ms-border-radius: $radius;
      -o-border-radius: $radius;
      border-radius: $radius;
    }
    
    //定位上下左右居中
    @mixin center {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
    }
    
    //定位上下居中
    @mixin ct {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
    }
    
    //定位左右居中
    @mixin cl {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }
    
    // 字体和颜色
    @mixin fc($size, $color) {
      font-size: $size;
      color: $color;
    }
    
    // 字体颜色行高
    @mixin fclh($size, $color, $lh) {
      font-size: $size;
      color: $color;
      line-height: $lh;
    }
    
    // flex布局
    @mixin flex($buju: space-between) {
      display: flex;
      justify-content: $buju;
    }
  • 相关阅读:
    mongodb安装错误以及原理
    animate.css使用
    JavaScript面向对象的方式开发轮播图插件
    数组/对象深拷贝
    JavaScript中数组的方法和字符串方法总结
    远程管理命令
    python+selenium 滑动滚动条的操作
    远程管理命令:
    文件和目录命令二:
    文件和目录命令一:
  • 原文地址:https://www.cnblogs.com/hahahakc/p/13093753.html
Copyright © 2020-2023  润新知