質問内容
掲題の件につきまして
現実コードではrgbaに括弧がない状態です。
求めている夢コードの様に出力させたく
試行錯誤してみましたが、夢を実現できないため
ご質問させていただきました。
質問内容としてはリストに括弧を代入とさせていただきましたが
他の方法で夢を実現できればご教示願います。
宜しくお願い致します。
・scss
.hoge{
width: 100px;
height: 100px;
$bglist:(232,110,164,.5),(94,169,221,.5),(120,193,91,.5);
@for $i from 1 through 3{
&:nth-child(#{$i}){
background-color:rgba nth($bglist,$i)
}
}
}
・現実コード
.hoge {
width: 100px;
height: 100px;
}
.hoge:nth-child(1) {
background-color: rgba 232, 110, 164, 0.5;
}
.hoge:nth-child(2) {
background-color: rgba 94, 169, 221, 0.5;
}
.hoge:nth-child(3) {
background-color: rgba 120, 193, 91, 0.5;
}
・夢コード
.hoge {
width: 100px;
height: 100px;
}
.hoge:nth-child(1) {
background-color: rgba(232, 110, 164, 0.5);
}
.hoge:nth-child(2) {
background-color: rgba(94, 169, 221, 0.5);
}
.hoge:nth-child(3) {
background-color: rgba(120, 193, 91, 0.5);
}
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/08/21 16:13
2015/08/21 16:58
2015/08/21 17:00