Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
セルフセレクターの作成方法がわかりません。私の最善の推測は次のとおりです。
.mixin(@var) { &(~':nth-of-type(@{var}n)') { // do stuff } }
しかし、
.el { .mixin(3); }
プロデュース
.el :nth-of-type(3n) { //do stuff }
そして、望ましい結果を生み出すことができません。
この面での助けをいただければ幸いです。ありがとう。
使用している LESS のバージョンによって異なりますが、1.3.3 では動作するはずです。
.mixin(@var) { @nthItem: ~":nth-of-type(@{var}n)"; &@{nthItem} { // do stuff } }