To know the sass structure [closed]

The & tells the pre-processor to add the parent selector in-front of the nested class.

so this:

.class-name{
      background: blue
      &.class-name2{
          background: red;
      }
}

would compile too:

.class-name {background: blue;}
.class-name.class-name2 {background: red;}

The usage would be:

<div class="class-name">This background is blue</div>

and

<div class="class-name class-name2">This background is red</div>

Leave a Comment