Use @else
. You can check the full documentation here: SASS Docs
Basically, SASS is thinking that else
is a CSS keyword/identifier. It needs to be prefixed with the @
.
Ie, your code would become:
@mixin mixin-name {
@if (condition) {
.....
} @else {
&:nth-of-type(...) {}
}
}