Installing Sass
You see, browsers don’t understand Sass syntax. So that syntax needs to be translated into plain CSS before the browser can actually read it. And that’s what the Sass compiler does. It translates or compiles Sass to CSS.
Install Sass on Windows
Install
gem install sass
Uninstall
gem uninstall sass
Update
gem update sass
You can also specify the version. Ex:
gem install sass -v 3.4.13
Converting CSS to Sass
- Create Sass folder named
scss
- Rename the main .css style sheet using the .scss or .sass extension
- Place your styles file named
styles.scss
in thescss
folder - In the terminal, access your project’s working directory
- Use the –watch Command
sass -- watch scss:css
The --watch
command tells Sass to watch our project for changes, and it automatically converts our Sass files into CSS, placing them in a folder named css
.
Output:
write css/styles.css
write css/styles.css.map
Note: Keep your console running to keep it watching your project