9

I had to rewrite this every time I want to see a live preview.

sass stylesheet.scss stylesheet.css
  • Explain your question in more detail kindly – Failed Scientist Apr 25 '17 at 00:20
  • Possible duplicate of [How to convert directory SASS/SCSS to CSS via command line?](http://stackoverflow.com/questions/19439914/how-to-convert-directory-sass-scss-to-css-via-command-line) – Ismail Farooq Apr 25 '17 at 05:50
  • You can use a software. I use Koala App to do this for me. He runs automatically and watches for the file changing. Is tricky to config, but will help you a lot. – João Pedro Raldi Apr 24 '19 at 03:13

5 Answers5

18

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.

thewaywewere
  • 8,128
  • 11
  • 41
  • 46
3

Try out Grunt or Gulp with Sass: A great tutorial: https://www.taniarascia.com/getting-started-with-grunt-and-sass/

Marko Bajlovic
  • 323
  • 5
  • 12
1

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/

gwally
  • 3,349
  • 2
  • 14
  • 28
1

you can use this code

sass --watch file.sass:file.css

or

sass --watch foldersass:foldercss

-2

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.

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
winhole14
  • 1
  • 2
  • This is the same answer than the one already existing. Please don't answer questions if there is nothing more to say – Mattew Eon Nov 25 '22 at 15:16