在Windows上使用PHPStorm使用SASS开发 [英] Developing with SASS using PHPStorm on Windows

查看:226
本文介绍了在Windows上使用PHPStorm使用SASS开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows上运行PHPStorm IDE.

我想开始使用Zurb Foundation,并使用SCSS编写样式表.我需要安装Ruby或Compass吗?

每当我编辑.scss文件时,是否有办法让PHPStorm在我的项目中(在每个项目的自定义路径中)自动为我编译.css样式表?

我已经看到了这个 http ://www.jetbrains.com/phpstorm/webhelp/transpiling-sass-less-and-scss-to-css.html ,但看起来该说明适用于运行Windows的unix系统.

到目前为止,我已经执行了以下操作:

  1. 我先安装了 http://rubyinstaller.org/然后
  2. 已将ruby/bin文件夹中的sass和指南针宝石成功安装
  3. 此后,我指向PHPStorm中的项目设置",并告诉了在哪里寻找Compass

这时我该怎么办?使用Compass变量为我的项目定义config.rb,以便在哪里查找SASS文件以及在哪里进行编译?我该怎么办?

解决方案

如果您不使用特定于指南针的内容,例如其特定的功能和mixins,我建议您使用SASS编译器从SCSS中创建CSS.

SCSS文件监视程序的设置非常简单,您不需要创建任何rb文件.

类似的东西:

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

请注意,正如@LazyOne提到的那样,您需要在PATH中添加C:\Ruby193\bin才能使此项工作.

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?

解决方案

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.

这篇关于在Windows上使用PHPStorm使用SASS开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆