1. Open Sublime, install package Sass, Sass Build, Sublimeonsavebuild
2. If SASS is not installed, open the Iterm,gem (Ruby tool) installation Sass
sudo Install Sass
3. Configure the compilation directory
Open Sublime
Tools-Build system-New build system, paste code-Save (Mysass.sublime-build)
Tools-Build System-Mysass
{ "cmd": ["Sass", "--update", "$file: ${file_path}/. /css/${file_base_name}.css ","--stop-on-error ","--no-cache ","--style "," expanded ","--sourcemap=none "], "selector": "Source.sass, Source.scss", "Line_regex": "Line ([0-9]+):", "OSX": { "path": "/usr/local/bin: $PATH" }, "Windows": { " Shell ":" True " }}
4. Do not compile the file beginning with the underscore _
Sublime text, Preferences, package Setting, Sublimeonsavebuild, Settings-user
{ "Filename_filter": "(/|\\\\|^) (?! _) (\\w+) \ \. (CSS|JS|SASS|LESS|SCSS) $ "}
Sass Scss with Sublime