【问题标题】:materializecss framework rails 4.2 integrationmaterializecss框架rails 4.2集成
【发布时间】:2015-01-27 12:39:40
【问题描述】:

我找到了this css 框架,不幸的是,它缺乏像 Twitter 引导程序那样的 gem 支持。

所以我下载了他们的 sass 源代码并尝试集成到 Rails 资产管道中,尽管有错误。

Undefined variable: "$button-height".
  (in /app/assets/stylesheets/components/_buttons.scss:4)

或者我应该把它放到 /lib 文件夹中吗?

我的问题是:如何使用 rails 4.2 安装这个框架?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 asset-pipeline css-frameworks


    【解决方案1】:

    您可以使用bower 或使用此宝石https://github.com/mkhairi/materialize-sass

    我在使用 bower 实现字体时遇到了一些问题,我建议使用 gem =)

    【讨论】:

      【解决方案2】:

      我找到了将 gem 添加到 Gemfile 中的解决方案

      就这样吧:

      gem 'materialize-sass'
      

      并更新 Gems,在您的资产/样式表中搜索 applications.css,如果您有“.css”扩展名,您需要将其重命名为 applications.scss,最后添加此导入 @import "物化";

      /*
       * This is a manifest file that'll be compiled into application.scss, which will include all the files
       * listed below.
       *
       * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
       * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
       *
       * You're free to add application-wide styles to this file and they'll appear at the bottom of the
       * compiled file so the styles you add here take precedence over styles defined in any styles
       * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
       * file per style scope.
       *
       *= require_tree .
       *= require_self
       */
       @import "materialize";
      

      :)

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-11-17
        • 1970-01-01
        • 2012-03-31
        • 1970-01-01
        • 2010-10-21
        相关资源
        最近更新 更多