Developing with SASS using PHPStorm on Windows

时光怂恿深爱的人放手 提交于 2019-12-07 11:33:46

问题


I'm running PHPStorm IDE on Windows.

I would like to start using Zurb Foundation and write my stylesheets using SCSS. Do I need to install Ruby or Compass to do so?

Is there a way to let PHPStorm automatically compile .css stylesheets for me in my projects (in custom paths for each project) whenever I edit a .scss file?

I've seen this http://www.jetbrains.com/phpstorm/webhelp/transpiling-sass-less-and-scss-to-css.html but looks like the instructions are for a unix system, while I run windows.

So far I did the following:

  1. I've installed http://rubyinstaller.org/ then
  2. successfully installed the sass and compass gems in the ruby/bin folder
  3. After this I pointed went to Project Settings in PHPStorm and told where to look for Compass

At this point what should I do? Define a config.rb for my project with Compass variables for where to look for SASS files and where to compile them? What else should I do?


回答1:


If you are not using compass-specific stuff like its specific functions and mixins, I'd suggest using SASS transpiler to create CSS out of SCSS.

SCSS file watcher settings are rather simple, and you don't need any rb files being created.

Something like:

Program: C:\Ruby193\bin\scss.bat
Arguments: --no-cache --update $FileName$:$FileNameWithoutExtension$.css
Working directory: $FileDir$
Output paths: $FileNameWithoutExtension$.css

Note that, as @LazyOne has mentioned, you need to have C:\Ruby193\bin in your PATH to make this work.



来源:https://stackoverflow.com/questions/20701996/developing-with-sass-using-phpstorm-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!