Frontend - sass nesting, .child{.parent & { }} invalid?
迷茫
迷茫 2017-05-15 16:59:45
0
1
490
<span ng-class="{'group-expand': isExpand}">
    <i class="icon-arrow-right"></i>
</span>
@mixin rotate($deg) {
  -webkit-transform: rotate($deg);
  -moz-transform: rotate($deg);
  -ms-transform: rotate($deg);
  -o-transform: rotate($deg);
  transform: rotate($deg);
}

//solution1
.icon-arrow-right {
    @include rotate(0deg);
    .expand & {
        @include rotate(90deg);
    }
}

//solution2
.icon-arrow-right {
    @include rotate(0deg);
}
.expand .icon-arrow-right {
    @include rotate(90deg);
}

Excuse me why solution1 is invalid?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(1)
刘奇

Copy your code and the compilation is successful
Maybe it’s a version problem with your scss

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template