Does the scss file automatically keep the css file updated?

I just started working with scss a few days ago (using Webstorm), and it looks like it automatically generates / updates the css file after saving the scss file. Unfortunately, when I save the scss file now, no changes are made to the css file. I worked on these files from another place, so I assume that the settings for Webstorm may be different. I thought file watchers could do something about it, but I'm not sure what is going on in the program area. I really don't know why this is happening.

+6
source share
2 answers

No, saving the .SCSS file .SCSS not automatically compile the final stylesheet file. You need to set the clock. There are several ways to do this (and a number of programs that will do this for you).

The easiest way forward is through the command line. Assuming you have SASS gem installed (and you are in a ruby โ€‹โ€‹environment), follow these steps on the command line:

  • Go to the folder where your .scss files are stored.

  • Run the following command: sass --watch style.scss:style.css

Note. The above assumes that both your .scss and .css files are called styles, adjust them accordingly if they are not. Also, if your .css and .scss files are in different directories, you will have to adjust the paths accordingly.

Remember sass --watch , then yourScssFile.scss : yourCssFile.css

Alternatively, you can use an application like LiveReload to view files for you. it depends a little on the configuration, but it might be a little easier for you if you are just starting to work in the wornderful world of SCSS / SASS

+10
source

Yopu can use File Watchers in WebStorm to automatically update the CSS file when SCSS changes; but it will also require the installation of an external SCSS compiler (SASS gem). For more information see http://www.jetbrains.com/webstorm/webhelp/transpiling-sass-less-and-scss-to-css.html#d104715e458

0
source

All Articles