Inheriting Selectors in SASS
When working with styles, problems with inheritance can arise. However, with the @extend directive, they are easily avoided, since it clearly specifies which selector should inherit the styles of another. Let's look at an example:
Let's look at an example:
.warning {
border: 1px solid;
background-color: #ffd900;
}
.personalWarning {
@extend .warning;
border-width: 3px;
}
Now let's look at the compilation result:
.warning, .personalWarning {
border: 1px solid;
background-color: #ffd900; }
.personalWarning {
border-width: 3px;
}
Tell me what the result of compiling the following code will be:
#product-card {
color: #302f2f;
font-family: 'Times New Roman', Times, serif;
}
#product-card-title {
@extend #product-card;
font-weight: 600px;
}
Change the conditions of the previous problem so that #product-card inherits from #product a width of 500px.