|
@@ -1,3 +1,4 @@
|
|
|
+// @import 'max.scss';
|
|
|
$bgcolor: #ff0000;
|
|
|
$keyName: 'color';
|
|
|
$whiteColor: #000000;
|
|
@@ -96,4 +97,105 @@ div2{
|
|
|
}
|
|
|
.del-btn{
|
|
|
@include logo-btn()
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+.wrapper {
|
|
|
+ width: 100px;
|
|
|
+ height: 30px;
|
|
|
+ font-size: 10px;
|
|
|
+ .inner{
|
|
|
+ //@extend 继承某一个选择器的样式
|
|
|
+ //如果继承的选择器 有子选择器 会一并继承过来
|
|
|
+ //编译的时候 会将相同的样式 转化成分组选择器
|
|
|
+ @extend .wrapper;
|
|
|
+ padding: 20px;
|
|
|
+ p{
|
|
|
+ color: $bgcolor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+#main{
|
|
|
+ @extend .wrapper;
|
|
|
+ margin: 10px
|
|
|
+}
|
|
|
+
|
|
|
+$width: 5.9px;
|
|
|
+
|
|
|
+.content{
|
|
|
+ // width: ceil($width);
|
|
|
+ // height: abs(-10px);
|
|
|
+ width: percentage(30 / 100);
|
|
|
+}
|
|
|
+//@function 定义函数
|
|
|
+@function changeWidth($width){
|
|
|
+ @return $width * 2
|
|
|
+}
|
|
|
+.last{
|
|
|
+ width: changeWidth(4);
|
|
|
+}
|
|
|
+$list: 1px solid #000;
|
|
|
+
|
|
|
+div{
|
|
|
+ width: changeWidth(40px);
|
|
|
+ border-top: $list;
|
|
|
+}
|
|
|
+section{
|
|
|
+ border-bottom: $list;
|
|
|
+}
|
|
|
+//列表要用逗号分割
|
|
|
+$colorList: red,blue,pink,green;
|
|
|
+
|
|
|
+p{
|
|
|
+ //nth($list,index)通过索引获取列表当中的第index项
|
|
|
+ color: nth($colorList,2)
|
|
|
+}
|
|
|
+
|
|
|
+$length: 2;
|
|
|
+li{
|
|
|
+ //@if 指令 (与js中的if效果相同)
|
|
|
+ //sass 中的逻辑判断 and or not
|
|
|
+ @if $length > 0 and $length < 3{
|
|
|
+ font-size: 12px;
|
|
|
+ } @else if $length >= 3{
|
|
|
+ font-size: 16px;
|
|
|
+ }@else{
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+//through 包含3
|
|
|
+@for $i from 1 through 3 {
|
|
|
+ .list-#{$i}{
|
|
|
+ width: $i * 100px;
|
|
|
+ }
|
|
|
+}
|
|
|
+//to 不包含3
|
|
|
+@for $i from 1 to 3{
|
|
|
+ .none-#{$i}{
|
|
|
+ width: $i * 100px;
|
|
|
+ }
|
|
|
+}
|
|
|
+//each in 循环列表
|
|
|
+@each $var in $colorList {
|
|
|
+ .content-#{$var}{
|
|
|
+ color: $var;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+$a: 3;
|
|
|
+@while $a > 0 {
|
|
|
+ .h-#{$a} {
|
|
|
+ width: 2px * $a;
|
|
|
+ }
|
|
|
+ $a: $a - 1;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|