Answer the question
In order to leave comments, you need to log in
Which method is better to use @extend % template or @extend .class?
Hello.
Which method is better to use, more convenient, which takes less time to compile?
@extend %template or @extend .class ?
If I'm not mistaken, they work the same way.
Thank you!
Answer the question
In order to leave comments, you need to log in
the template extend substitutes the template in the block of rules you need, and the class extend takes the selector for which you apply it and substitutes it with a comma to the class .. that is:
%placeholder {
font-weight: bold;
}
a%placeholder {
text-decoration: none;
}
.item {
@extend %placeholder
}
.item {
font-weight: bold;
}
a.item {
text-decoration: none;
}
.placeholder {
font-weight: bold;
}
a.placeholder {
text-decoration: none;
}
.item {
@extend .placeholder
}
.placeholder, .item {
font-weight: bold;
}
a.placeholder, a.item {
text-decoration: none;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question