Vanmeeganathan P K
Vanmeeganathan P K

Reputation: 211

What does &- mean in &-link in the below code?

I am new to scss. What does &- mean in the below code ?

        .btn{
          border: 0;
          font-size: 14px;
          font-weight: bold;  
          &-link {
              background-color: $white;
              color: $orange;
          }
        }

Upvotes: 1

Views: 73

Answers (1)

ale917k
ale917k

Reputation: 1768

This:

.btn{
   &-link {
      background-color: $white;
      color: $orange;
   }
}

Will be compiled into:

.btn-link {
   background-color: $white;
   color: $orange;
}

Reference: https://css-tricks.com/the-sass-ampersand/#modifying-the-ampersand

Upvotes: 1

Related Questions