Compile Sass to CSS using npm. [ EASIEST WAY!! ]

preview_player
Показать описание
Hey there!

In this video, I'll be showing you the quickest way to compile Sass to CSS using npm.

Step 1:
-- Make a sass folder with a .scss file inside that folder
-- Make a css folder with a .css file inside that file
-- Write all of your Sass to your .scss file

Step 2:
-- Open terminal
-- type npm init
-- type npm i node-sass --save-dev

Step 3:
-- make a "compile:sass" script
-- define the script as below:

Step 4:
-- in the terminal type: npm run compile:sass
-- see your css file now. you'll see your new compiled code.
-- add a -w tag to the script definition so that when you're running compile:sass, it will keep updating the css file without you having to keep typing it in manually

This is the person who showed me how to do this but it's on a udemy course that costs money to see so thats why i put it on here:

Thanks for watching. Please like, subscribe, and comment what else little tricks you would like to know. Have a good day and realize the only thing holding you back from being a trillionaire is you :).. you can do it.

Рекомендации по теме
Комментарии
Автор

Now node-sass is at his 9 version, but this method is still working. Thanks a million :)

romyt
Автор

that's true man, u can not find it nowhere, I had the same problem a few months ago... and i just forgot how to do it, because I haven't code since then....I also do UI design...thou. Good on you.This is going to be very helpful.

Have a good day.

michaelandreuzza
Автор

A ton of thanks man. Please make some more video like this. This is a very easiest way to use sass.

mizanalharun
Автор

Good explanation in a few minutes of video, thank so much!

miguelalonso
Автор

If you guys having problem it is probably because node-sass.
node-sass is deprecated and doesn't support node 18. Replace it with sass

emirhandemir
Автор

Bro, the best explanation ever. thanks.

MsDEADEnd
Автор

thanks so much you are just amazing . This is definitely easier than using gulp

kenkinyua
Автор

Thanks man! That was quick, easy and useful!

libraro
Автор

wow thank you so much. this is what i was looking for! you are awesome!

Автор

Thanks bro, and I really couldn't find it anywhere

ALI-seph
Автор

Sweet vidz dood -> had to move over from Ruby Sass. How long have you been using Sass?

JeremyBoulerice
Автор

Why it doesn't work with me i compiled but nothing has been changed in the css file

seddikdounia
Автор

Nice one! I thought I needed Gulp or Grunt to do that. Can you also watch a folder with many SASS files?

ehrlichesmitteilenfrankfurt
Автор

thanks man. but can you make a video on how to deploy it to github pages
please

Anwangabasi
Автор

hello i used node js and my set up looks correct very similar to yours even when I save my work it complies it. I wanted to double check with you to see if my set up looks correct.
im using sublime text
thank you

raulmartinez
Автор

i did exactly what you did in your video but i keep getting this error:
status": 3,
"message": "File to read not found or unreadable:

iJuce
Автор

Thanks. But how do you compile a minified version?

JoshuaMusau
Автор

why do we use node-sass in React instead of regular sass package?

rodmm
Автор

Hello, thank you for the video. I wanna ask can we compile more different files in the same directory because I tried and it fails. Thank you very much again !

anastasija
Автор

I have this error
An output directory must be specified when compiling a directory
npm ERR! code ELIFECYCLE
npm ERR! errno 1

cristianrunaldu