原來 SASS 的「&」表示重複上一個迴圈的 selector,所以如果寫
.btn {
...
.navbar & {
background: lightsteelblue;
}
}
compile 後會變成
.btn {
...
}
.navbar .btn {
background: lightsteelblue;
}
文章內還有相鄰選擇器的例子供大家參考,我也多學到一招了 XDDD
http://blog.teamtreehouse.com/sass-tip-double-ampersand-selector
同時也有10000部Youtube影片,追蹤數超過2,910的網紅コバにゃんチャンネル,也在其Youtube影片中提到,...
css parent selector 在 The closest thing we have to a CSS parent selector - YouTube 的美食出口停車場
Sign up for updates and so you don't miss out on the launch! https://cssdemystified.com/While we don't have ... ... <看更多>