How can I Include .scss
file in another .scss
file?
I was trying to write this in a file:
app.scss:
@include('buttons');
@include('dropzone');
body {
background: $primaryColor;
overflow-x: hidden; /*Clip the left/right edges of the content inside the <div> element - if it overflows the element's content area: */
height: 100%; /* Cover all (100%) of the container for the body with its content */
padding-top: 70px;
} /* more css code here */
and it returns an error : invalid css after @import
I try to include 2 other scss files inside the main scss
file, so it will be all compiled to one css
file eventually. How is it possible?
You can include a partial by doing this:
The imported file needs an underscore, so sass will recognize it to be included: _partial.scss
Ok, so it appears to be that my
app.scss
file collide with Bootstrap.css file. Because I wanted theapp.scss
background
property to apply, instead of the bootstrap css file. I've added!important
in this property to override bootstrap style.:Also,
gulpfile.js
has been updated to suite my needs accordingly:And that's how I fixed it.
You can import it like this;
According to your directories and it will do what you want.