开发者

is there a way to use 960 and compass with sproutcore?

Is there a way to do this? I know Compass can be used in sproutcore, but i also want to use the 960 comp开发者_Go百科ass plugin. I tried dong import "960/grid" in my app.css but it keeps throwing an error


Well, there is a way it works but I'm not sure if there is a cleaner solution. I just setup a test-project with sproutcore 1.6 and handlebar templates

 # sc-init MyTest --template

and added an additional "test_960.scss" file in apps/MyTest/resources/stylesheets with the following content

 @import "960/grid";

 $ninesixty_columns: 16;

 #wrapper {
      @include grid_container;
      background-color: red;
 }

However, this does not work since sc-server isn't able to detect the 960 compass plugin. You can easily spot this if you are running sc-server with the -v flag to get the debug output. You'll find an exception like this

 Sass::SyntaxError: File to import not found or unreadable: 960/grid.
 Load paths:
      /Users/myuser/.rvm/gems/ruby-1.9.2-p180/gems/compass 0.11.3/frameworks/blueprint/stylesheets
      /Users/myuser/.rvm/gems/ruby-1.9.2-p180/gems/compass-0.11.3/frameworks/compass/stylesheets
      Compass::SpriteImporter
      [...]

The problem is, that the 960 compass plugin isn't installed within gems/compass 0.11.3/frameworks but in gems/compass-960-plugin-0.10.3. What you can do so, is create a symlink into the framework directory, like that

 # cd gems/compass 0.11.3/frameworks
 # ln -s ../../compass-960-plugin-0.10.3 960

Stop and restart sc-server and the above example will run now.

I don't know if this has any bad implications on other compass based applications. As said, it works for sproutcore but I had not the time to test it further. This also works with other plugins. Moreover, I did not test if this does also compile correctly when you build your final application.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜