'How to compile a sass file with the rest of the html code?
I am building a website with HTML and CSS and I must also use an SCSS file, but when I try to update the page the elements defined in the SCSS file are not read. I would like to know how to compile a sass file with the rest of the program. When i insert a style file i put this in html:
<link rel="stylesheet" href="style.css">
With SCSS what should I put?
Solution 1:[1]
Installing SASS on
Windows:
npm install -g sassin your VS-Code Terminal ORchoco install sassmacOS or Linux:
brew install sass/sass/sass
Then try sass .\folder\example.scss .\folder\example.css to compile your SCSS file.
Or try sass --watch .\folder\example.scss .\folder\example.css to compile the SCSS File live.
Solution 2:[2]
You need to run sass --watch example.scss style.css in the terminal on same folder where your SCSS file. It will compile your SCSS code into CSS.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | RPI-Server |
| Solution 2 | Amandeep Singh |
