SCSS-循环

382 阅读1分钟
$colors: red yellow blue;

.wrap{
  p{
    @for $i from 1 through 3{
      &:nth-child(#{$i}){
        color: nth($colors, $i)
      }
    }
  }
}