1:1の管理(forだとnthに変数を使えず怒られた。)
$objects:(
1: 29px,
2: 50px,
3: 58px,
4: 45px,
5: 48px,
6: 44px,
);
@each $num, $width in $objects {
$icon-width: $width;
&:nth-child(#{$num}) {
.planListIcon object {
width: $icon-width;
}
}
}
$num: "";
@for $i from 1 through 10 {
@if $i < 10 {
$num: "0#{$i}";
} @else {
$num: $i;
}
li:nth-child(#{$i}) a {
background-image: url(/contents/c/shop/image/category/syokuhin/img_cat#{$num}.png);
}
}
@for $i from 0 through 2 {
&:nth-child(#{$i + 1}) {
background-image: url(../img/home/img_merit0#{$i + 1}.jpg);
}
}