In short, Sass:
To use node-sass, you first need the node package manager (npm) installed on your computer. To download it, just click this link.
Once you have npm installed, follow the steps below to set up your project folder.
npm init
npm install node-sass
In the package.json file, replace the scripts element with this:
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"compile-scss": "node-sass scss-folder -o css-folder",
"compile-scss-continuously": "node-sass -w scss-folder -o css-folder"
},
Create a folder called scss-folder. Then, create a .scss file and write some Sass code in it. Here's some sample code:
$primary-color: red;
p {
color: $primary-color;
}
npm run compile-scss
npm run compile-scss-continuously
After completing step 4, you should see a folder named "css-folder" that holds the relevant CSS files. If you used the sampe code above in your Sass file, the output should look like this:
p { color: red; }
And there you have it. You have successfully been able to write Sass code and compile it
into CSS.