[Sass] Installing and Using Sass on Windows for Beginners



Hello all,

If you are a Beginner in Sass then this tutorial is for you.

And do share it if you found it useful at the end. This blog follows Simple steps to create an application which uses sass.

Installing Sass on Windows

First we need to install Ruby using the Link. Look for the (x64) version.


What is Ruby?

Ruby is the technology Sass is built on. So you need to install ruby first so Sass can run on top of it. 

Important noteWhile installing Ruby make sure that you have 'Add ruby executable in your path' option checked.

Steps To Use Sass

Now lets start with the Sass part in the most easiest way because many other tutorials complicate things too much.

Follow the steps below:

1. Create a demo folder in any of your drive.

2. Inside that folder create two sub folders /css and /scss.

3. Now create a .scss file in you /scss folder and name it demo-style.scss. Yes, this is your Sass file. But its empty now.

4. Now open this /demo folder in you command line. 

Tip: Easiest way to go to /demo folder inside command line is to drag and drop the folder inside command line after you change your directory to the specific drive in which you have saved your demo folder.

5. Here comes the cool part. 
    
    Now we need to let Sass watch our .scss files and make it compile to .css.
 
    So in cmd write this command:

                            Sass --watch sass:css

    --watch command:  It is not a command. It is a flag. The watch flag tells Sass to pay attention to the /css and /scss folders. So that any change in .scss files can be detected and converted into css automatically which you can use in your websites.
6. Edit the .scss file and watch Sass compile it to .css file.

    I. Open your folder in any text editor.
    II. Open demo-styles.scss file and add some css in it.
    III. Save the file and verify in your command line that the compiling to .css was successful. 
    IV. Now open your demo-styles.css inside your /css folder.
    

Final Words

 Yeah, we are finally done in setting up and using Sass in your local machine.

  If you need any other simplified post on Basics of Sass, drop me a message, I'd be glad to help.

  Thank For Reading!!!

  Also if you find it useful than do Recommend it below.



Comments

Post a Comment

Popular posts from this blog

Google maps places autocomplete using Angular 2

Range Slider Uisng Javascript and CSS for changing the selected part Color