How can I setup compass on netbeans 7.4

最后都变了- 提交于 2019-12-08 20:35:17

问题


There is a feature in netbeans 7.4 that allows scss and less to auto compile on save.

I have managed to set up scss to compile but I am having problems compiling scss files using compass.

Here is an example error:

Syntax error: File to import not found or unreadable: compass/css3.
          Load path: /www/site
    on line 2 of /www/site/app/View/Themed/Admin/webroot/scss/core.scss

Currently the compass is imported like so:

@import "compass/css3";

Thanks


回答1:


  1. In NetBeans, click the File > Project Properties menu item.
  2. In the dialog that opens, select the CSS Preprocessors category.
  3. At the bottom of the Sass properties is Compiler options. Enter --compass

That fixed the problem you are asking about for me. However, I then encountered further problems with Compass because it was ignorant of the paths to files. To overcome this I created a config.rb file in the root of my project. This had to define a full project path and directory names. Moreover, working on a Windows machine, it was fussy about the direction of slashes and types of quotes.

project_path    = 'c:\path\to\project'
css_dir         = "css"
sass_dir        = "sass"
images_dir      = "images"
javascripts_dir = "js"



回答2:


Another way that you can add Compass to all SASS projects without adding the argument to each project is by going to Tools > Options > Miscellaneous > CSS Preprocessors and adding " --compass" to the end of the Sass Path.

For example, mine reads "C:\Ruby200-x64\bin\sass.bat --compass".



来源:https://stackoverflow.com/questions/19175866/how-can-i-setup-compass-on-netbeans-7-4

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