I had to rewrite this every time I want to see a live preview.
sass stylesheet.scss stylesheet.css
I had to rewrite this every time I want to see a live preview.
sass stylesheet.scss stylesheet.css
I use sass --watch stylesheet.scss:stylesheet.css
. When saving your .scss
file, it'll automatically update the .css
file.
You might also consider sass --watch stylesheet.scss:stylesheet.css --style expanded --sourcemap=none
to keep the .css
file readable.
I'd recommend the Sass Workflow class on Udemy.
Try out Grunt or Gulp with Sass: A great tutorial: https://www.taniarascia.com/getting-started-with-grunt-and-sass/
You need something to compile it automatically. As an example, there are solutions that use node.js to automatically compile for you on your computer. One tool is Foundation for Websites by Zurb.
You can install the application which will automatically compile sass for you.
For more information, check out: http://foundation.zurb.com/sites/download.html/
you can use this code
sass --watch file.sass:file.css
or
sass --watch foldersass:foldercss
Sass can be compiled automatically using below command:
sass --watch SASS_SOURCE_PATH:CSS_BUILD_PATH --style=expanded --no-source-map
Where:
SASS_SOURCE_PATH
: Path of sass file
CSS_BUILD_PATH
: Path of build CSS file. Where do you want to save CSS file
--no-source-map
: will not output a map file, which is not readable.
--style=expanded
: will expand CSS to human readable.
© 2022 - 2024 — McMap. All rights reserved.