您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

sass 常用函数的整理

2024/3/11 0:36:18发布22次查看
@charset "utf-8"; @import "compass/css3/inline-block"; @import "compass/css3/border-radius"; @import "compass/utilities/sprites"; @import "compass/utilities/general"; @mixin position($top,$right,$bottom,$left) { top: $top; right: $right; bottom: $bottom; left: $left; } //尺寸 @mixin mysize($width,$height:$width) { width: $width; height: $height; } /*行高,兼容ie8*/ @mixin lineheight($value) { line-height: $value; line-height: $value \9 ; line-height: $value \0 ; } //背景透明,文字不透明。兼容ie8 @mixin bettertransparentize($color, $alpha) { $c: rgba($color, $alpha); $ie_c: ie_hex_str($c); background: rgba($color, 1); background: $c; background: transparent \9 ; zoom: 1; filter: progid:dximagetransform.microsoft.gradient(startcolorstr=#{$ie_c}, endcolorstr=#{$ie_c}); -ms-filter: "progid:dximagetransform.microsoft.gradient(startcolorstr=#{$ie_c}, endcolorstr=#{$ie_c})"; } //添加浏览器前缀 @mixin browserprefix($propertyname,$value) { @each $prefix in -webkit-, -moz-, -ms-, -o-, '' { #{$prefix}#{$propertyname}: $value; } } //最小高度 @mixin minheight($height) { min-height: $height; height: auto !important; @if $legacy-support-for-ie { _height: $height; } } //固定宽度子元素,水平垂直居中 @mixin center($width:null,$height:null) { @if $width and $height { position: absolute; left: 50%; top: 50%; display: block; margin-left: -($width/2); margin-top: -($height/2); } //@if not $width and not $height { // @include browserprefix(transform,translate(-50%, -50%)); //} @else if $width and $height { // margin: -($width / 2) #{0 0} -($height / 2); //} @else if not $height { // width: $width; // margin-left: -($width / 2); // @include browserprefix(transform,translatey(-50%)); //} @else { // margin-top: -($height / 2); // @include browserprefix(transform,translatex(-50%)); //} } //圆角,兼容ie8 @mixin radius($value) { @include border-radius($value); -ms-behavior: url(./css/pie-1.0.0/pie.htc); }
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product