zoukankan      html  css  js  c++  java
  • base_haley.scss(最基础的base级scss样式)

    //display
    .db{display: block}
    .di{display: inline}
    .dib{display: inline-block}
    .hide{display: none;}
    .show{display:block;}
    .tdn{text-decoration: none;}
    
    //text
    .tl{text-align: left}
    .tr{text-align: right}
    .tc{text-align: center}
    .tj{text-align: justify}
    .tin2{text-indent: 2em;}
    
    .vm{vertical-align: middle;}
    
    //margin padding
    @mixin m($a){margin: $a;}
    @mixin mt($a){margin-top: $a;}
    @mixin ml($a){margin-left: $a;}
    @mixin mr($a){margin-right: $a;}
    @mixin mb($a){margin-bottom: $a;}
    @mixin p($a){padding: $a;}
    @mixin pt($a){padding-top: $a;}
    @mixin pl($a){padding-left: $a;}
    @mixin pr($a){padding-right: $a;}
    @mixin pb($a){padding-bottom: $a;}
    
    .m0{@include m(0)}
    .mt0{@include mt(0)}
    .mb0{@include mb(0)}
    .mr0{@include mr(0)}
    .ml0{@include ml(0)}
    .p0{@include p(0)}
    .pt0{@include pt(0)}
    .pb0{@include pb(0)}
    .pr0{@include pr(0)}
    .pl0{@include pl(0)}
    
    @for $i from 5 to 100 {
      @if($i%10==0){
        .mt#{$i} {
          @include mt($i+px);
        }
      }
    
    }
    //height line-height
    @mixin h($h){height:$h}
    @mixin lh($lh){line-height:$lh}
    @mixin w($w){$w}
    //fz
    @mixin fz($fz){font-size: $fz;}
    
    //color
    @mixin c($c){color:$c}
    
    //border
    @mixin b($c:#f00,$w:1px,$s:solid) {border:$w $s $c}
    @mixin bb($c:#f00,$w:1px,$s:solid){border-bottom:$w $s $c}
    @mixin bt($c:#f00,$w:1px,$s:solid){border-top:$w $s $c}
    @mixin bl($c:#f00,$w:1px,$s:solid){border-left:$w $s $c}
    @mixin br($c:#f00,$w:1px,$s:solid){border-right:$w $s $c}
    
    //float
    @mixin floatSide($side,$value: 10px) {
      float: $side;
      margin-#{$side}: $value;
    }
    // rounded
    @mixin rounded($vert, $horz, $radius: 10px) {
      border-#{$vert}-#{$horz}-radius: $radius;
      -moz-border-radius-#{$vert}#{$horz}: $radius;
      -webkit-border-#{$vert}-#{$horz}-radius: $radius;
    }
    @mixin borderR($r:50%){
      -webkit-border-radius: $r;
      -moz-border-radius: $r;
      border-radius: $r;
    }
    /*
    arrow(direction,
    size,
    color);
    */
    @mixin arrow($direction,
    $size,
    $color) {
       0;
      height: 0;
      line-height: 0;
      font-size: 0;
      overflow: hidden;
      border- $size;
      cursor: pointer;
      @if $direction == top {
        border-style: dashed dashed solid dashed;
        border-color: transparent transparent $color transparent;
        border-top: none;
      }
      @else if $direction == bottom {
        border-style: solid dashed dashed dashed;
        border-color: $color transparent transparent transparent;
        border-bottom: none;
      }
      @else if $direction == right {
        border-style: dashed dashed dashed solid;
        border-color: transparent transparent transparent $color;
        border-right: none;
      }
      @else if $direction == left {
        border-style: dashed solid dashed dashed;
        border-color: transparent $color transparent transparent;
        border-left: none;
      }
    }
    /* icon
    */
    $arr:home, about, product, contact ,joinus;
    @each $member in $arr {
      .#{$member} {
        background-image: url("/image/ico-#{$member}.jpg");
      }
    }
    /*!
     top right bottom left
    */
    @mixin abs-pos ($top: auto, $right: auto, $bottom: auto, $left: auto) {
      top: $top;
      right: $right;
      bottom: $bottom;
      left: $left;
      position: absolute;
    }
    
    /*!
    media query
    */
    $breakpoints: (
            'sm': 'only screen and  (min- 480px)',
            'md': 'only screen and ( min- 768px)',
            'lg': 'only screen and ( min- 992px)',
            'lg13': 'only screen and ( min- 1366px)',
            'lg14': 'only screen and ( min- 1440px)',
            'lg19': 'only screen and ( min- 1920px)'
    ) !default;
    
    @mixin respond-to($breakpoint) {
      $query: map-get($breakpoints, $breakpoint);
    
      @if not $query {
        @error 'No value found for `#{$breakpoint}`. Please make sure it is defined in `$breakpoints` map.';
      }
    
      @media #{if(type-of($query) == 'string', unquote($query), inspect($query))} {
        @content;
      }
    }
    
    //用法
    .foo {
      @include respond-to('sm') {
        padding-left: 20px;
        padding-right: 20px;
      }
    }
    //产出
    @media only screen and (min- 480px) {
      .foo {
        padding-left: 20px;
        padding-right: 20px;
      }
    }
  • 相关阅读:
    /etc/sysctl.conf 控制内核相关配置文件
    python 并发编程 非阻塞IO模型
    python 并发编程 多路复用IO模型
    python 并发编程 异步IO模型
    python 并发编程 阻塞IO模型
    python 并发编程 基于gevent模块 协程池 实现并发的套接字通信
    python 并发编程 基于gevent模块实现并发的套接字通信
    python 并发编程 io模型 目录
    python 并发编程 socket 服务端 客户端 阻塞io行为
    python 并发编程 IO模型介绍
  • 原文地址:https://www.cnblogs.com/haley168/p/scss.html
Copyright © 2011-2022 走看看