SASS TRAP

/**
 *  Created by nettie_jin
 */

/*在scss文件中用 @import url(本文件地址) 来调用;*/
@charset "UTF-8";
/*定义媒体查询*/
	/*_config.scss*/
	$breakpoints: (
	  'mobile': 'screen and (max-width: 414px)',/*移动端设备最大宽度414*/
	  'pc_sm': 'screen and (min-width: 415px) and (max-width : 680px)',/*PC端(或类PC端)设备415-680*/
	  'pc_md': 'screen and (min-width: 681px) and (max-width : 960px)',/*PC端(或类PC端)设备681-960*/
	  'pc_lg': 'screen and (min-width: 961px)'/*PC端设备961以上*/
	) !default;
	/*_mixins.scss*/
	@mixin response-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;
	  }
	}

/*-----------------
	调用方法:@include response-to(mobile){移动端媒体查询样式};
--------------------*/

/*宽高百分百 传参自定义宽高*/
@mixin full($w:100%,$h:100%){
    width:$w;
    height:$h;
    overflow: hidden;
}
@mixin size($w,$h){
    width:$w;
    height:$h;
}
/*设置定位 默认相对定位*/
@mixin pos($val:relative){
    position: $val;
}
/*设置高度并且内容居中*/
@mixin hCenter($h){
	height:$h;
	line-height: $h;
}
/*设置背景渐变*/
/* background-image: linear-gradient(to bottom, rgba(72, 72, 72, 0.5) 0%, rgba(68, 68, 68, 0.1) 20%, rgba(0, 0, 0, 0.5) 100%);*/
/*设置背景图片 逗号隔开参数 必须传参使用 url repeat size position*/
@mixin bg_img($url,$repeat,$size,$pos){
	background-image:url($url); 
	background-repeat: $repeat;
	background-size: $size;
	background-position: $pos;
}
/*设置背景颜色 默认白色*/
@mixin bg($c){
	background-color: $c;
}
/*设置border*/
@mixin bdStyle($width,$style,$color){
	border-width:$width;
	border-color: $color;
	border-style: $style;
}
/*多行文本超出范围显示 '...' 传入想要显示的行数*/
@mixin mulellipsis($n){
	overflow : hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: $n;
	-webkit-box-orient: vertical;
}

/*定位居中 父级需加相对定位*/
@mixin center($w,$h){
	width:$w;
	height:$h;
	position: absolute;
	top:50%;
	left: 50%;
	margin-left: -$w/2;
	margin-top: -$h/2;
}
/*设置超出宽度部分显示为省略号*/
@mixin ellipsis($w){
	width:$w;
	text-overflow:ellipsis;
	white-space: nowrap;
	overflow: hidden;
}
/*弹性盒(新)row/column*/
@mixin flex($val:row){
    display:-webkit-flex;
    display:-moz-flex;
    display:-ms-flex;
    display:-o-flex;
    display:flex;
    -webkit-flex-direction:$val;
    -moz-flex-direction:$val;
    -ms-flex-direction:$val;
    -o-flex-direction:$val;
    fex-direction:$val;
}
/*字体大小及颜色*/
@mixin fontStyle($size,$color){
	font-size: $size;
	color:$color;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值