我正在使用Susy 2,我有这段代码:
@include breakpoint($tab) {
.l-region--sections {
> .block {
@include span(6 of 12);
&:nth-child(2n) {
@include last;
}
}
}
}
@include breakpoint($desk) {
.l-region--sections {
> .block {
@include span(4 of 16);
&:last-child {
@include last;
}
}
}
}
问题是在桌面宽度上,“:nth-child(2n)”生效,我想完全删除它,而不是“:last-child”。如何删除桌面的“:nth-child(2n)”样式?
答案 0 :(得分:2)
答案就在这里:https://github.com/ericam/susy/issues/328,基本上是:
@include breakpoint($tab) {
.l-region--sections {
> .block {
@include span(6 of 12);
&:nth-child(2n) {
@include last;
}
}
}
}
@include breakpoint($desk) {
.l-region--sections {
> .block {
@include span(4 of 16);
&:nth-child(2n) {
@include span(4 of 16); // We are declaring span for this container here once more, just to override nth-child styles.
}
&:last-child {
@include last;
}
}
}
}