使用这个SASS:
$priamry-dark: #333;
$nav-section-colors: (darkest, 10%) (darker, 15%) (dark, 20%) (medium, 30%) (light, 40%) (lighter, 50%) (lightest, 60%);
@each $color in $nav-section-colors {
.#{nth($color, 1)} {
background: lighten($primary-dark, #{nth($color, 2)});
}
}我得到了错误:
"10%" is not a number for `lighten'如果我手动输入lighten($primary-dark, 10%),它就能正常工作。任何百分比都会出现问题。
发布于 2014-09-05 01:25:34
因此,为了回答我自己的问题,删除插值(#{})并直接使用第n()的结果解决了我的问题。
感谢cimmanon为我指明了正确的方向。
https://stackoverflow.com/questions/25671371
复制相似问题