【发布时间】:2015-10-26 12:50:54
【问题描述】:
在下面的代码块中,我必须写 6 次才能将 $blue 更改为不同的颜色。必须有一种更简单、更 DRY 的方式来编写此代码。
&:nth-child(1) {
.fa-stack-1x { color: $white; }
.fa-circle { color: $blue; }
hr {
background: $blue;
background-image: linear-gradient(to right, $white, $blue, $white);
}
&:hover {
background: $blue;
.fa-stack-1x { color: $blue; }
.fa-circle { color: $white; }
a {
background-color: $white;
color: $blue;
}
hr {
background: $white;
background-image: linear-gradient(to right, $blue, $white, $blue);
}
}
}
【问题讨论】:
标签: sass