zoukankan      html  css  js  c++  java
  • 我的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;
    }
  • 相关阅读:
    网页返回码大全
    求数组中子数组的最大和
    什么是面向对象?面向对象与面向过程的区别?
    Java内部类
    Java拆箱装箱
    linux中su和sudo区别
    Linux 中账户管理
    解决warn appiumdoctor bin directory for $java_home is not set
    Moco之include
    Mock server 之 Moco的使用
  • 原文地址:https://www.cnblogs.com/hahahakc/p/13093753.html
Copyright © 2011-2022 走看看