sass @for code example
Example 1: loops scss
@for $i from 1 through 3 {
ul:nth-child(3n + #{$i}) {
background-color: lighten($base-color, $i * 5%);
}
}
Example 2: sass loops
$base-color: #036;
@for $i from 1 through 3 {
ul:nth-child(3n + #{$i}) {
background-color: lighten($base-color, $i * 5%);
}
}
Example 3: scss loop
@each $theme-name, $theme-color in $colors-theme-bo {
.theme-#{$theme-name} {
color: $theme-color;
}
}