If you're looking to incorporate another sass file without rendering the content for @extends
, one approach is to create and import a partial filled with %placeholders
designed for using @extend
. However, this method may not work as expected, as shown here:
_import.scss
%button {
color: #fff;
width: 72px;
height: 24px;
}
main.scss
@import "import";
.button-blue {
@extend %button;
background-color: blue;
}
main.css
.button-blue {
color: #
width: 72px;
height: 24px; }
.button-blue {
border: 1px solid #fff; }
In my opinion, utilizing mixins in your style by importing a partial would be more effective. Personally, I've used sass for six months now and haven't faced the need to use @extends
thus far. Feel free to share your specific requirements regarding @extend
, and I can assist you in achieving it using a @mixin
.