Beginners Guide to SASS CSS Preprocessor

What is SASS?

SASS is a CSS Preprocessor. http://sass-lang.com/

Installing and compiling

  1. Install Ruby https://rubyinstaller.org/
    • More Info : http://sass-lang.com/install
  2. Open Terminal or Command Prompt
gem install sass

Note : gems is a package manager for Ruby.

3. Check if sass got installed

sass -v

4. on a dedicated "test" folder , create two folders "scss" and "css"

C:\test

C:\test\scss

C:\test\css

5. In the Terminal or Command Prompt

C:\test>

Compile SASS

--watch command

--watch command is used to constantly monitor style.scss file for any changes and compile it as soon any change happens.

C:\test> sass --watch scss:css

sass --watch scss:css

--watch dedicated file

To watch dedicated file style.scss and style.css

sass --watch style.scss:style.css

style.scss is the main file

style.css is the complied file

Minify SASS

sass --watch scss:css --style compressed

Leave a Reply

Your email address will not be published. Required fields are marked *

*