How Inheritance Works in SASS

The gist of the @extend directive is that it adds an extending selector to any stylesheet where the extending selector appears (in our example, .warning):

Let's look at an example:

style.scss.warning {
  border: 1px solid;
  background-color: #ffd900;
}
.warning .instruction {
  background-image: url("/image/warning.png");
}
.personalWarning {
  @extend .warning;
  border-width: 3px;
}

Now let's look at the compilation result:

style.css.warning, .personalWarning {
  border: 1px solid;
  background-color: #ffd900;
}

.warning .instruction, .personalWarning .instruction {
  background-image: url("/image/warning.png");
}
    
.personalWarning {
  border-width: 3px;
}
Задание 1

Tell me what the result of compiling the following code will be:

styles.scss#product-card p{
  color: #460707;
  padding: 10px;
}

#product-card-title {
  @extend #product-card;
  font-weight: 600px;
}
Задание 2

Tell me what the result of compiling the following code will be:

styles.scss.link .main-block{
  font-size: 14px;
  text-decoration: dashed;
}

.active-link {
  @extend .link;
  color: red;
}
Задание 3

Tell me what the result of compiling the following code will be:

styles.scss.link .main-block{
  font-weight: bold;
  text-decoration: none;
}

.active {
  color: red;
}

.active-link {
  @extend .link;
  @extend .active;
}