whao 3 年之前
父節點
當前提交
f2469f4acc
共有 1 個文件被更改,包括 6 次插入20 次删除
  1. 6 20
      src/assets/styles/base.scss

+ 6 - 20
src/assets/styles/base.scss

@@ -729,16 +729,9 @@ div::-webkit-scrollbar {
 				padding: .4rem .5rem;
 				box-shadow: $shadowList;
 				flex-wrap: wrap;
-				@each $c in $iconBg {
-					$i: index($iconBg, $c); // 获取 $c 在数组中的索引,并赋值给 $i 赋值用冒号,不是等号~!
-				
-					.icon-con:nth-child(#{$i}) .icon {
-						// 经典的地方来了,SCSS 循环是从 1 开始,不是 0 哦~
-						background: $c; // 背景色
-				
-						&:hover {
-							background: lighten($c, 10%); // hover 后的颜色
-						}
+				@for $i from 1 through length($iconBg) {
+					.icon-con:nth-child(#{length($iconBg)}n+#{$i}) .icon{
+						background:nth($iconBg, $i);
 					}
 				}
 				.icon-con{
@@ -968,16 +961,9 @@ div::-webkit-scrollbar {
 				align-items: center;
 				// padding: .25rem .5rem;
 				flex-wrap: wrap;
-				@each $c in $iconBg {
-					$i: index($iconBg, $c); // 获取 $c 在数组中的索引,并赋值给 $i 赋值用冒号,不是等号~!
-				
-					.icon-con:nth-child(#{$i}) .icon {
-						// 经典的地方来了,SCSS 循环是从 1 开始,不是 0 哦~
-						background: $c; // 背景色
-				
-						&:hover {
-							background: lighten($c, 10%); // hover 后的颜色
-						}
+				@for $i from 1 through length($iconBg) {
+					.icon-con:nth-child(#{length($iconBg)}n+#{$i}) .icon{
+						background:nth($iconBg, $i);
 					}
 				}
 				.icon-con{