Web Developer

SASS Section 1 – Commands

  1. install SASS: sudo gem install sass
  2. check SASS version: sass -v
  3. convert file type between .scss and .sass:
    1. sass-convert example.scss exsample.sass
    2. sass-convert example.sass exsample.scss
  4. convert .sass to .css file:
    1. sass example.scss:example.css
  5. to synchronous update .css files from .scss file, using watch command
    1. sass –watch example.scss:example.css (so when you change .scss file content, the .css file content will be automatically updated)
    2. sass –watch folderWithScssFiles : folerWantToStoreConvertCssFilesFromFolderWithScssFiles
    3. using ctrl + c to stop watching (stop synchronous updating)
  6. in order to style exort .css file, using –style compact/compressed/expanded comand:
    1. sass example.scss:example.css –style compact
    2. sass example.scss:example.css –style compressed (lightest version)
    3. sass example.scss:example.css –style expanded
  7. stop generate css map file
    1. sass example.scss:example.css –style compact –sourcemap=none