如何在没有炼油厂插件的情况下在炼油厂CMS中设置Compass?

tai*_*nsu 3 refinerycms compass-sass

根据此讨论,在炼油厂CMS中使用Compass时需要使用refinery-theming插件.但炼油厂主页的页面表示不再使用它.无论如何在炼油厂使用Compass而不使用插件?非常感谢.

b73*_*b73 8

我通过执行以下操作在炼油厂网站中使用Compass:

1)将Compass依赖项添加到您的Gemfile:

gem "compass"
gem "haml"
Run Code Online (Sandbox Code Playgroud)

2)运行bundle install

3)初始化应用程序指南针

compass init rails /path/to/myrailsproject
Run Code Online (Sandbox Code Playgroud)

4)覆盖Refinery shared/_head.html.erb partial:

rake refinery:override view=shared/_head
Run Code Online (Sandbox Code Playgroud)

5)将以下样式表链接标记添加到共享/ _head.html.erb:

<%= stylesheet_link_tag 'screen', :media => 'screen, projection' %>
<%= stylesheet_link_tag 'print', :media => 'print' %>

<!--[if IE ]>
<%= stylesheet_link_tag 'ie.css', :media => 'screen, projection' %>
<![endif]-->
Run Code Online (Sandbox Code Playgroud)

6)我个人从shared/_head.html.erb中删除所有其他stylesheet_link_tag

7)您的样式现在应添加到app/stylesheets/screen.scss并包含部分内容

  • 谢谢!值得注意的是:在最新版本的Refinery中,覆盖变为:`rake refinery:override view = refinery/_head`. (2认同)