2019年2月18日
摘要: /*使用自定义function和@each实现栅格布局*/ @function buildLayout($num: 5){ $map: (defaultValue: 0); //不能直接生成col,需要设置一个默认值 $rate: percentage(1 / $num); //均分并取百分数 @f 阅读全文
posted @ 2019-02-18 17:10 小虾米吖~ 阅读(280) 评论(0) 推荐(0) 编辑
摘要: /*内置函数*/ /*1)常规的rgb,rgba函数*/$color:rgb(255,255,162);body{ color: $color; background-color:rgba($color, 0.5); /*2)lighten,darken函数*/ span{ color: darke 阅读全文
posted @ 2019-02-18 16:42 小虾米吖~ 阅读(195) 评论(0) 推荐(0) 编辑
摘要: @mixin content($color:red,$fontSize:14px){ color:$color; font-size: $fontSize;} /*调用含参数的mixin,使用更加灵活1、传递多个属性的参数时需要指定变量名,否则将无法找到是哪个属性2、一个参数需传递多个参数值时,需在 阅读全文
posted @ 2019-02-18 16:06 小虾米吖~ 阅读(516) 评论(0) 推荐(0) 编辑
摘要: /*变量操作 (两个变量之间的运算符需要用空格隔开,否则会报错。)==,!= <,>,<=,>=+,-,*,/,% */ $width1:50px;$width2:100px;body{ width: $width1 + $width2; height: $width2 - $width1;} /* 阅读全文
posted @ 2019-02-18 15:37 小虾米吖~ 阅读(366) 评论(0) 推荐(0) 编辑
摘要: /*继承:@extend ,继承多个类时使用逗号隔开*/.alert{ color: #f00;}.info{ width: 100px;} .text-danger{ background-color: #f0f; @extend .alert,.info;} /*链式继承*/.one{ colo 阅读全文
posted @ 2019-02-18 14:36 小虾米吖~ 阅读(229) 评论(0) 推荐(0) 编辑
摘要: /*注意:定义的变量若是没有使用则不会编译到css文件中。*//*1)sass的局部变量*/$font:14px;//定义$font:12px !default; //没有default时是重新赋值,有了它则先取12再重新赋值为14$maps:(color:black,border-color: b 阅读全文
posted @ 2019-02-18 11:06 小虾米吖~ 阅读(487) 评论(0) 推荐(0) 编辑