@include is used for mixins. Find the mixin, and copy that css into the class that is including it.
@mixin red {
color: red;
}
.roster-text {
@include red;
}
.button-text {
@include red;
}
.roster-text {
color: red;
}
.button-text {
color: red;
}
Similar to mixins, but used for extending pre-existing classes. It can intelligently recognize two classes extending the same styles, and concatenate them together in the compiled output.
.red {
color: red;
}
.roster-text {
@extend .red;
}
.button-text {
@extend .red;
}
.red {
color: red;
}
.roster-text, .button-text {
@extend .red;
}
New hotness in Sass 3.2 . Similar to above, except instead of needing a pre-existing class, placeholders (represented with %) are not compiled into the final output. So you get the benefit of the intelligent concatenation in the compiled output like the original @extend method, but the "class" you're extending from does not need to exist or be compiled, like with an @include)
%red {
color: red;
}
.roster-text {
@extend %red;
}
.button-text {
@extend %red;
}
.roster-text, .button-text {
color: red;
}