I'm reviewing this issue as I was looking for that precise solution and got it working on Sublime 3 Windows.
Firstly you want to install Ruby Installer (with 'add to path variables' option enabled), and then just open a cmd and type:
gem install compass
Then you'll need to create a Sublime Build System, as originally suggested on a related SASS question. It will run a simple command line. In my case, my config.rb
file was located in project/foo/bar/theme
and the .scss
files in project/foo/bar/theme/scss
, to make things scalable and have different possible themes configuration, I left the Build System more relative to the file path. So the build system is as simple as:
{
"shell_cmd": "compass compile ../",
"selector": "source.scss",
}
Save this build system, like "Compile SCSS". And, with the .scss
file open select it on Tools > Build System > Compile SCSS
. Also check Tools > Save All on Build
to save on evey build.
Now, if you open your .scss
file and hit Ctrl+B
, Sublime will run the command, compile the file and save the .scss
. So now instead of Ctrl+S
to save, just use Ctrl+B
. But still SFTP don't automatically uploads the generated .css
file.
To do that, you'll need to find the .css
file on the left sidebar, right click and go SFTP/FTP > Monitor File (Upload on External Save)
and leave the file tab open (thanks to EranSch on this related question).
Now, every time you push Ctrl+B
on your .scss
file, SFTP will upload it, Sublime will command to compile it, SFTP will upload the .css generated files (given they are open).