I ran sass --watch styles.scss:styles.css in my css folder.
And it can watch the changes if I make edits to styles.scss
But in the styles.scss, I imported some other sass files from a different folder. And if I make changes in other files, it doesn't watch and translate those changes.
Anyone know a solution?
As of October 2021 @import will be deprecated, along with global built-in functions, and one year after that (no later than October 2022) @import support will be dropped.
Fundamentally both rules do the same thing - load members inside another module. The main differences is how they handle members. @import makes everything globally accessible in the target file.
Watching for changes in SASS Just add a --watch flag in the command to watch the changes made to the Sass file in src/styles directory. That's it. Now, the changes you make in the SASS file will automatically be compiled into CSS as soon as you save the SASS file!
The SASS @import function helps us to import multiple SASS or CSS stylesheets together such that they can be used together. Importing a SASS file using the @import rule allows access to mixins, variables, and functions to the other file in which the other file is imported.
// main.scss
@import "./partials/_normalize";
@import "./partials/_article";
use a next command to watch both: a folder and a file
scss --watch ./partials/ ./main.scss
The underscore lets Sass know that the file is only a partial file and that it should not be generated into a CSS file http://sass-lang.com/guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With