scss变量拼接问题

我的颜色值在外部定义过了,分别是$task-run-status-green-color,$task-run-status-red-color等等。。。;
要想通过拼接使用这几个变量该怎么写?

$list: 'green','red','blue','purple','orange','gray';

@for $i from 1 through 6 {
  .#{nth($list,$i)} {
    color: $task-run-status-#{nth($list,$i)}-color; // 这句应该怎么拼接才对???,我这样写是不对的

    .seal-icon {
      color: nth($colorList, $i);

    }
  }
}
阅读 2.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进